You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was getting the exception mentioned in the title here and after some reading I gathered that I had to specify a .NET Core app in the project startup option of dotnet ef tool.
This seemed to work great at first and I could add my first migration but, as you can see from issue I logged on EntityFrameWorkCore project the other DbContexts could not be found.
Then I was informed that I should be able to use dotnet ef migrations add command from a .NET Standard class library without needing to specify a different startup project.
I then tried this with EFCore for SqlServer and it worked.
So I'm back at the exception mentioned here in the title.
I looked at issue #32 but, that seems Linux specific and I'm on Win 8.1 with VS 2017.
Any help will be appreciated!
Update
If I do the most basic setup with Identity and Identity Server 4 (see DataAccess proj in repro) in a:
new .NET Standard (1.4) class library (dotnet ef migrations add fails with error in title)
new .NET Core (1.1) class library (dotnet ef migrations add fails with error in title)
new .NET Core (1.1) MVC Web App with no auth (dotnet ef migrations addworks!)
I have no idea what the MVC template is adding that makes Npgsql.TypeHandlerRegistry happy??
Update 2
So from dotnet/efcore#7557 I updated Microsoft.EntityFrameworkCore.Tools.DotNet package to version 1.0.1 and now I'm able to add migrations to .NET Core (1.1) class library.
Initially I added System.Diagnostics.DiagnosticSource manually and received error in title but, then I saw it was already added as v4.3.0 and I searched for that error and came across issue 7557 above.
However, updating Microsoft.EntityFrameworkCore.Tools.DotNet package to 1.0.1 in .NET Standard class library did not solve issue. Now it's probably just down to a missing package...
The text was updated successfully, but these errors were encountered:
qvsmith
changed the title
The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception (.NET Standard class library)
The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception (class libraries)
Jul 31, 2017
Thanks for the hint!
Updating the version of Microsoft.EntityFrameworkCore.Tools.DotNet to 1.0.1 didn't help until I changed the sdk in my *.csproj file from <Project Sdk="Microsoft.NET.Sdk"> to <Project Sdk="Microsoft.NET.Sdk.Web">
Initially I submitted and issue on EntityFrameWorkCore dotnet/efcore#9274
Please see that issue for background info.
Repro project: https://github.com/qvsmith/migration-issue-repro
I was getting the exception mentioned in the title here and after some reading I gathered that I had to specify a .NET Core app in the project startup option of dotnet ef tool.
This seemed to work great at first and I could add my first migration but, as you can see from issue I logged on EntityFrameWorkCore project the other DbContexts could not be found.
Then I was informed that I should be able to use dotnet ef migrations add command from a .NET Standard class library without needing to specify a different startup project.
I then tried this with EFCore for SqlServer and it worked.
So I'm back at the exception mentioned here in the title.
I looked at issue #32 but, that seems Linux specific and I'm on Win 8.1 with VS 2017.
Any help will be appreciated!
Update
If I do the most basic setup with Identity and Identity Server 4 (see DataAccess proj in repro) in a:
dotnet ef migrations add
fails with error in title)dotnet ef migrations add
fails with error in title)dotnet ef migrations add
works!)I have no idea what the MVC template is adding that makes Npgsql.TypeHandlerRegistry happy??
Update 2
So from dotnet/efcore#7557 I updated Microsoft.EntityFrameworkCore.Tools.DotNet package to version 1.0.1 and now I'm able to add migrations to .NET Core (1.1) class library.
Initially I added System.Diagnostics.DiagnosticSource manually and received error in title but, then I saw it was already added as v4.3.0 and I searched for that error and came across issue 7557 above.
However, updating Microsoft.EntityFrameworkCore.Tools.DotNet package to 1.0.1 in .NET Standard class library did not solve issue. Now it's probably just down to a missing package...
The text was updated successfully, but these errors were encountered: