的Web API 2的AccountController我使用ASP.NET 2.2的身份在Web API 2項目,但我不確定如何連接起來使用Autofac的AccountController
的ISecureDataFormat<AuthenticationTicket>
依賴。注漿ISecureDataFormat使用Autofac
我嘗試這樣做:
builder.RegisterType<ISecureDataFormat<AuthenticationTicket>>()
.As<TicketDataFormat>();
,並收到錯誤:
The type 'Microsoft.Owin.Security.ISecureDataFormat`1[Microsoft.Owin.Security.AuthenticationTicket]' is not assignable to service 'Microsoft.Owin.Security.DataHandler.TicketDataFormat'
的,我碰到的問題似乎都不使用ASP.NET身份的最新穩定版本一起使用。
任何幫助,非常感謝。
您能與我們分享您嘗試過什麼,錯誤信息是什麼? –
我試過這個:'builder.RegisterType>()。作爲();'並得到錯誤:類型'Microsoft.Owin.Security.ISecureDataFormat'1 [Microsoft.Owin.Security.AuthenticationTicket ]'不能分配給服務'Microsoft.Owin.Security.DataHandler.TicketDataFormat'。 –