我有一个新的ASP.NET Core 1 RC2应用程序。 (Visual Studio,IIS Express)。它在同一个数据库中具有身份验证和数据(至少目前为止):
services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<ApplicationIdentityContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
我可以看到Identity部分有效(如果我“注册”,则在AspNetUsers表中创建一条记录)。但是,任何通过MyDbContext获取数据的尝试都会抛出错误
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's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
对于System.Security.Cryptography.Algorithms
Nuget,我可以选择4.1.0-rc2和4.0.0-beta。两者都抛出相同的错误
我从其他地方找到了安装System.Net.Security
,Microsoft.NETCore.Platforms
的建议 - 但它无济于事