-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
area-TypeSystem-coreclruntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
I have generic classes/interface with 9 (or more) generic type parameters.
When the type is activated, the runtime crashes with a System.ExecutionEngineException.
There is not much information provided by the debugger: "Exception of type 'System.ExecutionEngineException' was thrown."
Everything works fine on .net 10 when having 8 or less parameters.
Everything works fine in earlier .net versions, even with 9 or more parameters.
Reproduction Steps
void Test()
{
var i = new MyEntity<string, string, string, string, string, string, string, string, string>(); // <-- Throws System.ExecutionEngineException in System.Reflection.MethodBaseInvoker.InvokeWithOneArg(...)
}
public sealed class MyEntity<TItem1, TItem2, TItem3, TItem4, TItem5, TItem6, TItem7, TItem8, TItem9> : IEditableEntity<TItem1, TItem2, TItem3, TItem4, TItem5, TItem6, TItem7, TItem8, TItem9>
{
public TItem1 Item1 {get; set;}
public TItem2 Item2 {get; set;}
public TItem3 Item3 {get; set;}
public TItem4 Item4 {get; set;}
public TItem5 Item5 {get; set;}
public TItem6 Item6 {get; set;}
public TItem7 Item7 {get; set;}
public TItem8 Item8 {get; set;}
public TItem9 Item9 {get; set;}
}
public interface IReadonlyEntity<TItem1, TItem2, TItem3, TItem4, TItem5, TItem6, TItem7, TItem8, TItem9>
{
TItem1 Item1 {get;}
TItem2 Item2 {get;}
TItem3 Item3 {get;}
TItem4 Item4 {get;}
TItem5 Item5 {get;}
TItem6 Item6 {get;}
TItem7 Item7 {get;}
TItem8 Item8 {get;}
TItem9 Item9 {get;}
}
public interface IEditableEntity<TItem1, TItem2, TItem3, TItem4, TItem5, TItem6, TItem7, TItem8, TItem9> : IReadonlyEntity<TItem1, TItem2, TItem3, TItem4, TItem5, TItem6, TItem7, TItem8, TItem9>
{
new TItem1 Item1 {get;set;}
new TItem2 Item2 {get;set;}
new TItem3 Item3 {get;set;}
new TItem4 Item4 {get;set;}
new TItem5 Item5 {get;set;}
new TItem6 Item6 {get;set;}
new TItem7 Item7 {get;set;}
new TItem8 Item8 {get;set;}
new TItem9 Item9 {get;set;}
}Expected behavior
An instance of the type should be created without error.
Actual behavior
- Runtime crashes
- System.ExecutionEngineException.
- "Exception of type 'System.ExecutionEngineException' was thrown."
Regression?
Code works fine with
- .net Framework 4.6.2 to 4.8
- .net 3.1 to .net 9.0
Bug appeared with .net 10.
- Reproduced with 10.0.102 (and earlier)
Known Workarounds
No workaround found.
Configuration
- .net 10.0.102
- Windows 11, 25H2, 26200.7623
- x64
- Visual Studio 2026, v18.2.0
Other information
The error was found in unit test (MSTest).
Metadata
Metadata
Assignees
Labels
area-TypeSystem-coreclruntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner