我在IIS中創建了一個網站。重建我的應用程序,它是一切OK,但重新啓動IIS網站之後,有一個錯誤:類重新啓動IIS網站後未註冊
Autofac.Core.Registration.CompoentNotRegisteredException: The registered service 'WYC.Core.Services.BlogService' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
發生了什麼事?爲什麼?我的方式:
container.RegisterAssemblyTypes(assemblies)
.Where(t => t.Name.EndsWith("Service"))
.SingleInstance()
.PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);
謝謝你,你太棒了! – PoppingKevin
歡迎來到StackOverflow。如果答案有幫助,不要忘記接受它以幫助其他用戶。請參閱[我應該怎麼做當有人回答我的問題?](http://stackoverflow.com/help/someone-answers)瞭解更多信息 –