相关疑难解决方法(0)

使用Autofac在Web API 2 AccountController中注入ISecureDataFormat

我在Web API 2项目中使用ASP.NET Identity 2.2,但我不确定如何连接使用AutofacISecureDataFormat<AuthenticationTicket>依赖.AccountController

我试过这个:

builder.RegisterType<ISecureDataFormat<AuthenticationTicket>>()
       .As<TicketDataFo??rmat>(); 
Run Code Online (Sandbox Code Playgroud)

并得到错误:

类型'Microsoft.Owin.Security.ISecureDataFormat`1 [Microsoft.Owin.Security.Authenticat ionTicket]'不能分配给服务'Microsoft.Owin.Security.DataHandler.TicketDataFormat'

我遇到的所有问题似乎都没有使用最新的ASP.NET身份稳定版本.

任何帮助是极大的赞赏.

asp.net dependency-injection autofac asp.net-web-api2 asp.net-identity-2

0
推荐指数
1
解决办法
1007
查看次数