Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

asp.net - Ambiguous reference issue (Microsoft.AspNet.Identity & Microsoft.AspNet.Identity.Core)

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...