c# - 将 asp.net MVC 从 5.0.0-beta2 更新到 5.0.0-rc1

标签 c# asp.net asp.net-mvc asp.net-mvc-5 asp.net-identity

昨晚,我决定尝试在我的应用程序中实现 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; }

IdentityStoreManagerIdentityAuthenticationManager 不再被识别。

有人成功迁移到 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/

相关文章:

c# - 在 SICP 中,它表示即使递归调用实际上是迭代的,C 中的内存消耗也会增加。为什么?

c# - 将搜索和排序功能添加到数据绑定(bind)包装器

c# - 从本地主机上的 Web api 删除身份验证

ajax - 使用 MVC 4 API Controller 发布 JSON

c# - 为配置部分提供智能感知/xsd 验证

c# - aspx 文件不包含函数定义,定义在连接的 aspx.cs 文件中

c# - 通过 ASP.NET C# 发送 HTTP 请求

asp.net-mvc - Azure Blob 文件存储策略

javascript - 如何在asp.net MVC中创建确认框(模式弹出窗口)?

c# - XAML 标签文本 : Binding + DynamicResource (String Format? )