efcore.pg: The CoreRT compiler fails with a StackOverflowException

From dotnet/corert#6372 by @frankzye.


I came an error:

Unhandled Exception: System.InvalidOperationException: A suitable constructor for type ‘Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategyFactory’ could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.

So I added the following lines to RD.xml:

<Assembly Name="Npgsql.EntityFrameworkCore.PostgreSQL">
  <Type Name="Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategyFactory" Dynamic="Required All"/>
</Assembly>

But when I compile, it throw an error “Process is terminating due to StackOverflowException”, microsoft.dotnet.ilcompiler\1.0.0-alpha-26919-01\build\Microsoft.NETCore.Native.targets(200,5): error MSB3073 xxx runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26919-01\tools\ilc" @"obj\release\netcoreapp2.1\win-x64\native\DataExplorer.ilc.rsp exit.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

So it seems like whatever is triggering this is happening within Database.Migrate(). But commenting out that line reveals a whole sequence of additional EF Core metadata issues.

Thankfully, it looks like some serious legwork has been done in dotnet/corert#6477 by @rubin55 and @MichalStrehovsky to document these issues. I’m working my way though those now before debugging the issue in the migrations code.

@rubin55 got EF core working in dotnet/corert#6477. It’s about finding all the places where EF uses reflection.

I’m cleaning up the provided sample now to repost as a repo. I haven’t worked with the AOT toolchain before, but I’ll see what I can do.

_See: https://github.com/austindrenski/EFCore.PG-653_

Related

dotnet/corert#6477