我已经在我的 ASP.NET 项目中安装了 ELMAH 1.1 .Net 3.5 x64,现在我收到了这个错误(每当我尝试查看任何页面时):
无法加载文件或程序集“System.Data.SQLite,Version=1.0.61.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。
说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.BadImageFormatException:无法加载文件或程序集“System.Data.SQLite,版本=1.0.61.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。
底部有更多错误详细信息。
我的活动解决方案平台是“任何 CPU”,我在 x64 Windows 7 上运行 x64,当然,处理器。我们使用这个版本的 ELMAH 的原因是因为 1.0 .Net 3.5(x86,这是它编译的唯一平台)在我们的 x64 Windows 服务器上给了我们同样的错误。
我试过为 x86 和 x64 编译,我得到了同样的错误。我试过删除所有编译器输出(bin 和 obj)。最后,我直接引用了 SQLite dll,这是项目在服务器上运行不需要的东西,我得到了这个编译器错误:
错误 1 警告为错误:程序集生成 -- 引用的程序集“System.Data.SQLite.dll”针对不同的处理器 MyProject
任何想法可能是什么问题?
更多错误详情:
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[BadImageFormatException:无法加载文件或程序集“System.Data.SQLite,版本=1.0.61.0,文化=中性,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly .nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) +127 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) +142 System.Reflection.Assembly。加载(字符串程序集字符串)+28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串程序集名称,布尔星指令)+46[ConfigurationErrorsException:无法加载文件或程序集“System.Data.SQLite,版本=1.0.61.0,Culture=neutral,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration .CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232
System.Web.Compilation.BuildManager.CompileGlobalAsax() +52 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337[HttpException(0x80004005):无法加载文件或程序集“System.Data.SQLite,版本=1.0.61.0,文化=中性,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize( ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729[HttpException(0x80004005):无法加载文件或程序集“System.Data.SQLite,版本=1.0.61.0,文化=中性,PublicKeyToken=db937bc2d44ff139”或其依赖项之一。试图加载格式不正确的程序。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8896783
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr ) +259