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.ilcompiler1.0.0-alpha-26919-01\build\Microsoft.NETCore.Native.targets(200,5): error MSB3073 xxx runtime.win-x64.microsoft.dotnet.ilcompiler1.0.0-alpha-26919-01\tools\ilc" @"objrelease\netcoreapp2.1\win-x64\native\DataExplorer.ilc.rsp exit.
any update?
Not yet. Will try to take a look at the upcoming weekend.
@frankzye Could you post a minimal repro for the issue? Currently I'm getting another error:
error MSB4184: The expression ""System.String[]".GetValue(1)" cannot be evaluated. Index was outside the bounds of the array.
@MichalStrehovsky Is there any way to get the method name which is failed to compile?
Sample.zip
@YohDeadfall please find the repo, and help to resolve, thanks.
@YohDeadfall How are things going?
I had no time to contribute for the last two weeks, sorry.
@roji @austindrenski Would you like to take a look at it?
I definitely won't have any bandwidth for this in the next few weeks... Possible afterwards
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_
dotnet/corert#6477
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.
I'm guessing that many/most of these issues are going to be EF Core-related, rather than specific to Npgsql - it's better to raise these with the EF Core team. I have no idea what the status of EF Core CortRT support is, or whether full CoreRT is a goal of theirs.
I'm guessing that many/most of these issues are going to be EF Core-related, rather than specific to Npgsql - it's better to raise these with the EF Core team.
That was my impression after putting in a few hours with it. I would be interested to see a working version, so if anyone makes headway, please keep us in the loop by updating here.
@rubin55 got EF core working in dotnet/corert#6477. It's about finding all the places where EF uses reflection.
FWIW if EF Core is made to work, the Npgsql provider shouldn't be much effort beyond that - I don't think we do much that's reflection-based.
Any update ?
Not really... https://github.com/dotnet/corert/issues/6477 still seems open even though @MichalStrehovsky mentioned he got EF Core working. The best way forward here is to see whether EF Core works on CoreRT with one of the built-in providers (SqlServer, Sqlient). If they do where Npgsql fails, then we should look into it, otherwise the issue belongs on the EF Core/CoreRT side.
Am closing this as a general EF Core issue (https://github.com/dotnet/corert/issues/6477). If, after EF Core works on CoreRT, we find a specific issue with the Npgsql provider (unlikely), we can revisit.
Most helpful comment
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.