昨晚,我决定尝试在我的应用程序中实现 SignalR,因为我使用 MVC 5,所以我不得不使用 SignalR 的 2.0 beta。
哦,天哪,真是个好时机。昨晚,Microsoft 还决定推出所有与 mvc 5 相关的包的 rc1,并且更新破坏了一些东西 - 主要是在 beta2 模板中的帐户 Controller 中。
public AccountController()
{
IdentityStore = new IdentityStoreManager();
AuthenticationManager = new IdentityAuthenticationManager(IdentityStore);
}
public AccountController(IdentityStoreManager storeManager, IdentityAuthenticationManager authManager)
{
IdentityStore = storeManager;
AuthenticationManager = authManager;
}
public IdentityStoreManager IdentityStore { get; private set; }
public IdentityAuthenticationManager AuthenticationManager { get; private set; }
IdentityStoreManager
和 IdentityAuthenticationManager
不再被识别。
有人成功迁移到 rc1 了吗?我找不到来自 MS 的任何文档或更新的模板。
最佳答案
更新以下 nuget 包:
- Microsoft ASP.NET Identity EntityFramework version="1.0.0-rc1"
- Microsoft.Owin.Security version="2.0.0-rc1"
- Microsoft.Owin.Security.OAuth version="2.0.0-rc1"
获取这些:
- Microsoft.AspNet.Identity.Owin version="1.0.0-rc1"
- Microsoft.Owin.Host.SystemWeb version="2.0.0-rc1"
那么你的 AccountController.cs 文件中仍然会有很多错误。 但是现在你的项目中有类来修复它们,或者你可以得到我的 AccountController.cs 文件,它是固定的,它编译并且应用程序运行,但是有一个地方(用 todo 评论:) 我不确定还没有。
您可以从我在 github 上的示例项目下载我的 AccountController.cs 文件: https://github.com/onybo/Asp.Net-Identity-RC1-sample-app
关于c# - 将 asp.net MVC 从 5.0.0-beta2 更新到 5.0.0-rc1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18416915/