我在我的页面上得到了以下错误:
Server Error in '/' Application.
The current type, Microsoft.Owin.Security.IAuthenticationManager, is an interface and cannot be constructed. Are you missing a type mapping? 我发现我应该将这段代码放在Unityconfig.cs中以解决这个问题:
container.RegisterType<IAuthenticationManager>(
new InjectionFactory(
o => System.Web.HttpContext.Current.GetOwinContext().Authentication
)
);但问题是IAuthenticationManager是不可见的。

虽然我添加了Owin.Security作为参考,但我有
using Microsoft.Owin.Security;你能给我一些提示吗?
发布于 2018-02-13 12:10:08
请注意,您试图使用的接口(Microsoft.Owin.Security.IAuthenticationManager不在Microsoft.Owin.Security.dll中,而是实际在Microsoft.Owin.dll中)。检查顶部的两行,这两行告诉您名称空间和程序集。因此,您只需添加对该程序集的引用。
对于这种情况,总是值得检查文档,因为名称空间并不总是等同于程序集名称。
https://stackoverflow.com/questions/48766122
复制相似问题