5

Last night, I decided to try and implement SignalR to my application, and because I use MVC 5, I had to use the 2.0 beta of SignalR.

And oh boy, what a timing. Last night, Microsoft also decided to roll out rc1 of all their mvc 5 related packages, and updating broke a few things - mostly in the account controller that is in the template for 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; }

IdentityStoreManager and IdentityAuthenticationManager are no longer recognized.

Has anyone successfully migrated to rc1 yet? I can't find any documentation or updated templates from MS.

Hao Kung
  • 28,040
  • 6
  • 84
  • 93
Inrego
  • 1,524
  • 1
  • 15
  • 25

3 Answers3

7

Update the following nuget packages:

  • 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"

Get these:

  • Microsoft.AspNet.Identity.Owin version="1.0.0-rc1"
  • Microsoft.Owin.Host.SystemWeb version="2.0.0-rc1"

Then you will still have a lot of errors in your AccountController.cs file. But now you have the classes in your project to fix them, or you could get my AccountController.cs file which is fixed, well it compiles and the application runs, but there is a spot (commented with todo:) that I am not sure about yet.

You can download my AccountController.cs file from my sample project on github here: https://github.com/onybo/Asp.Net-Identity-RC1-sample-app

Olav Nybø
  • 11,454
  • 8
  • 42
  • 34
  • Trying to run your sample project with Google authentication enabled throws an error: `Could not load 'Owin.AppBuilderLoggerExtensions' from assembly 'Microsoft.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'`. What can I do? – Konamiman Sep 20 '13 at 07:43
  • Solved! The `Microsoft.Owin.Security.Google` assembly version was 1.1.0-beta2. Upgraded to 2.0.0-rc1 and it works perfectly. – Konamiman Sep 20 '13 at 07:51
  • @Olav, do you have any idea why I am getting this after following your steps: The base class or interface 'Microsoft.AspNet.Identity.IdentityManager' in assembly 'Microsoft.AspNet.Identity.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' referenced by type 'Microsoft.AspNet.Identity.Owin.AuthenticationIdentityManager' could not be resolved – ledgeJumper Oct 28 '13 at 20:00
  • This would happen if Microsoft.AspNet.Identity.Owin is the RC1 version and you have a newer (release version) or older version of the Microsoft.AspNet.Identity.Core assembly where the IdentityManager used to be in the RC version. It is gone from the release version. I would recommend getting the release version instead of RC of everything now if possible. – Olav Nybø Oct 28 '13 at 21:12
4

IdentityStoreManager is now called IdentityStore

IdentityAuthenticationManager is now IdentityManager

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
  • It looks like these classes are different from the original ones. I can't seem to find anything replace the `CheckPasswordAndSignIn` method (or anything to login). So if these are indeed the new classes, I need help with migrating to using those instead of the ones from the beta2 version – Inrego Aug 24 '13 at 23:20
3

Those classes have moved types. Please look at the following commit to get more information on how to make AccountController work

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

pranav rastogi
  • 4,124
  • 23
  • 23