Skip to content

.NET 10 - System.ExecutionEngineException in System.Reflection.MethodBaseInvoker.InvokeWithOneArg #123318

Closed

Description

@vaLP2eh

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).

Activity

  1. added
    untriaged
    on Jan 17, 2026
  2. added
    needs-area-label
    on Jan 17, 2026
  3. added and removed
    needs-area-label
    on Jan 17, 2026
  4. jkotas commented on Jan 17, 2026

    @jkotas
    Member

    This works in 10.0.1 and fails in 10.0.2. Likely a regression from #120712

    cc @davidwrighton

  5. davidwrighton commented on Jan 20, 2026

    @davidwrighton
    Member

    This is a separate bug from #123254, but I'll be fixing it with a PR that covers both issues and adds regression tests.

  6. removed
    untriaged
    on Jan 22, 2026
  7. added
    untriaged
    on Jan 22, 2026
  8. davidwrighton commented on Jan 22, 2026

    @davidwrighton
    Member

    Reopening issue as the fix has not yet been backported to 10.0

  9. davidwrighton commented on Jan 24, 2026

    @davidwrighton
    Member

    The fix for this has been merged into 10.0.3.

  10. removed
    untriaged
    on Jan 24, 2026
  11. locked and limited conversation to collaborators on Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions