3

I'm building an AngularJS Single-Page App using the latest VS2015 Community and ASP.NET 5 etc...

The problem I'm now having while trying to implement an Authentication is that I need to use these two Namespaces:

Microsoft.AspNet.Identity //Version 3.0.0-beta4
Microsoft.AspNet.Identity.Owin //Version 2.2.1

but since Microsoft.AspNet.Identity.Owin has a dependency with

Microsoft.AspNet.Identity.Core 

I keep getting ambiguous reference issues, for example for UserManager which exists in both Microsoft.AspNet.Identity and Microsoft.AspNet.Identity.Core .

Has anyone else dealt with this before? Is it a version incompatibility issue or just the not complete Owin ASP.NET 5 implementation?

1 Answer 1

8

The Microsoft.AspNet.Identity.Owin package is part of ASP.NET Identity 2, not the newest version shipped with ASP.NET 5. Trying to reference it will download ASP.NET Identity 2 and cause the weird error you're experiencing.

Just reference Microsoft.AspNet.Identity and it should work.

Sign up to request clarification or add additional context in comments.

6 Comments

Understood, however without reference to it, it seems that I can't use methods that I need, for example AppBuilderExtensions.CreatePerOwinContext (cannot resolve symbol error)
These extensions were specially made for OWIN/Katana to make managers' lifetime management a bit easier. With dependency injection directly integrated to ASP.NET 5, they are no longer necessary (and won't work with ASP.NET Identity 3 anyway).
Oh I see.. Hm although you answered my questions, you created many new ones hehe Is there some reliable source of information for Identity 3 so that I can adapt to it? I was following some quides and tutorials which are obviously kind of obsolete in that way.. (Thank you by the way!)
You're welcome! The IdentitySample.Mvc sample you can find on github.com/aspnet/Identity is probably the best resource available right now: github.com/aspnet/Identity/tree/dev/samples/IdentitySample.Mvc. If you're looking for something more complete, don't miss the MusicStore sample: github.com/aspnet/MusicStore/tree/master/src/MusicStore
Thanks again! I will give these a go. By the way the guide I was mostly following was this one here: bitoftech.net/2015/01/21/… (Just so that I don't talk out of context)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.