Exception using EF Core 1 RC2: Failed to load file or assembly "System.Security.Cryptography.Algorithms"

I have a new ASP.NET Core 1 RC2 application. (Visual Studio, IIS Express). It has both authentication and data in one database (at least for now):

services.AddDbContext<MyDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddDbContext<ApplicationIdentityContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 

I see that the Identity part is working (if I "Register", the record is created in the AspNetUsers table). However, any attempts to get data through MyDbContext cause an error.

 An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary Additional information: Could not load file or assembly 'System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 

For System.Security.Cryptography.Algorithms Nuget gives me a choice of 4.1.0-rc2 and 4.0.0-beta. Both throw the same error

In some other places, I found advice to install System.Net.Security , Microsoft.NETCore.Platforms - but this will not help, either

+5
source share

All Articles