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

时间:2013-08-24 09:17:42

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

昨晚,我决定尝试将SignalR应用到我的应用程序中,因为我使用的是MVC 5,所以我不得不使用SignalR的2.0 beta。

哦,小伙子,什么时间。昨晚,微软还决定推出所有mvc 5相关软件包的rc1,并且更新打破了一些问题 - 主要是在beta2模板中的帐户控制器中。

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找到任何文档或更新的模板。

3 个答案:

答案 0 :(得分:7)

更新以下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

答案 1 :(得分:4)

IdentityStoreManager现在称为IdentityStore

IdentityAuthenticationManager现在是IdentityManager

答案 2 :(得分:3)

这些类已经移动了类型。请查看以下提交以获取有关如何使AccountController工作的更多信息

https://github.com/rustd/AspnetIdentitySample/commit/b09479a9e5c2d4ff16c459ce0e4105c5ac5302f4