嗨Iam在我的ASP.NET應用程序中引用一個託管的C++項目,該項目使用名爲「libmmd.dll」的本機DLL。如果我用visual studio運行ASP.NET應用程序,我會得到一個BadImageFormatException,它告訴我「模塊需要包含程序集清單」(德語翻譯)。BadImageFormatException從ASP.NET使用本機DLL
將本地dll包含到asp.net項目中的首選方式是什麼?在哪個目錄中搜索?在「C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files」路徑中,似乎只有託管程序集,而不是本機dll。
[FileNotFoundException: Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)]
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 forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)]
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) +227
System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337
[HttpException (0x80004005): Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)]
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): Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890751
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
我的電腦是32位,也都是Dll。當我將dll放入應用程序文件夾時,該庫在Windows窗體應用程序中工作。但在ASP.NET中,我不知道在哪個文件夾中放置該DLL。 – codymanix 2010-09-16 10:46:33
我嘗試了所有這些,但沒有任何幫助 – codymanix 2010-09-20 11:29:15
@codymanix so,Process Monitor的時間。 Win32從哪裏加載本地dll? – Richard 2010-09-20 12:15:34