1

我正在尝试在我的 ASP MVC 应用程序中使用Hangfire,我已将我的应用程序配置如下:

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseHangfire(config =>
        {
            config.UseSqlServerStorage("myconnstring");
            config.UseServer();
        });
    }
}

但是每次运行我的应用程序时都会出现以下错误:

[NotSupportedException: The invoked member is not supported in a dynamic assembly.]    
System.Reflection.Emit.InternalAssemblyBuilder.get_Location() +56       
log4net.Util.SystemInfo.AssemblyLocationInfo(Assembly myAssembly) +88   
log4net.Core.DefaultRepositorySelector.GetInfoForAssembly(Assembly assembly, String& repositoryName, Type& repositoryType) +256    
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType, String repositoryName, Boolean readAssemblyAttributes) +270    
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType) +58
log4net.Core.DefaultRepositorySelector.GetRepository(Assembly repositoryAssembly) +115    
log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssembly, String name) +180    
log4net.LogManager.GetLogger(Assembly repositoryAssembly, String name) +50    
log4net.LogManager.GetLogger(String name) +55
lambda_method(Closure , String ) +39    
Hangfire.Logging.LogProviders.Log4NetLogProvider.GetLogger(String name) +50    
Hangfire.Logging.LogProvider.GetLogger(String name) +103  
Hangfire.Logging.LogProvider.GetLogger(Type type) +53    
Hangfire.SqlServer.SqlServerObjectsInstaller..cctor() +65
4

0 回答 0