Asp.net 尝试将hangfire与企业库一起使用失败,原因是;无法使用ITypeRegistrationsProvider类型“;例外

Asp.net 尝试将hangfire与企业库一起使用失败,原因是;无法使用ITypeRegistrationsProvider类型“;例外,asp.net,enterprise-library,hangfire,Asp.net,Enterprise Library,Hangfire,我有一个ASP.NET应用程序,它使用企业库 当我安装Hangfirenuget pacakge时,应用程序拒绝启动,抛出以下异常: TypeLoadException:无法从程序集“Microsoft.Practices.EnterpriseLibrary.Common,Version=6.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”加载类型“Microsoft.Practices.EnterpriseLibrary.Common

我有一个ASP.NET应用程序,它使用企业库

当我安装
Hangfire
nuget pacakge时,应用程序拒绝启动,抛出以下异常:

TypeLoadException:无法从程序集“Microsoft.Practices.EnterpriseLibrary.Common,Version=6.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”加载类型“Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider”

如果我删除了
Microsoft.Owin.Host.SystemWeb
Nuget包,应用程序运行正常,但未调用Owin startp up类,并且我无法使用Hangfire中间件


如何使其工作?

这是在ASP.NET应用程序(还包括企业库)中尝试使用OWIN时,在某些配置中发生的一般错误

解决方案,以及问题的解释。简而言之,解决方案是在
web.config
appSettings
中配置启动类,如下所示:

<appSettings>  
  <add key="owin:AppStartup" value="-- your startup class --" />       
</appSettings>

这是一个一般性错误,当您尝试在ASP.NET应用程序(也包括企业库)中使用OWIN时,某些配置会发生此错误

解决方案,以及问题的解释。简而言之,解决方案是在
web.config
appSettings
中配置启动类,如下所示:

<appSettings>  
  <add key="owin:AppStartup" value="-- your startup class --" />       
</appSettings>