X.dll是我的C ++ / CLI dll,放在网站的bin文件夹中。它在本地计算机上运行正常,最初它在服务器上运行正常。但我改变了托管帐户,突然间我收到了这个错误。我应该以某种方式在web.config中引用这个程序集吗?我听说有类似的问题与非托管dll,但有问题的程序集是管理的。 完整信息:
无法加载文件或程序集“X.dll”或其某个依赖项。指定的模块无法找到。 System.Web.Compilation上的System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)中的System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()处的System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)。 System.Web.Compos.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory)上的System.Web.Comp.Manager.Compilation.BuildManager.CallPreStartInitMethods()中的System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()中的BuildManager.GetReferencedAssemblies(CompilationSection compConfig) ,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)无法加载文件或程序集“X.dll”或其依赖项之一。指定的模块无法找到。在System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,String codeBase,Evidence) assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks)System.Reflection.RuntimeAssembly的System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,Evidence assemblySecurity,StackCrawlMark& stackMark,Boolean forIntrospection,Boolean suppressSecurityChecks)。在System.Web.Configuration.CompilationSection.LoadAssemblyHelpe的System.Reflection.Assembly.Load(String assemblyString)处的InternalLoad(String assemblyString,Evidence assemblySecurity,StackCrawlMark& stackMark,Boolean forIntrospection) r(String assemblyName,Boolean starDirective) System.Web.Compilation上的System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)中的System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()处的System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)。 System.Web.Compos.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory)上的System.Web.Comp.Manager.Compilation.BuildManager.CallPreStartInitMethods()中的System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()中的BuildManager.GetReferencedAssemblies(CompilationSection compConfig) ,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)
答案 0 :(得分:5)
答案 1 :(得分:0)
听起来像是一个经典的权限问题。尝试为该文件提供Web服务器权限吗?
答案 2 :(得分:0)
如前所述,它与缺少的DLL有关。
我一直使用Microsoft Process Monitor来查找此类问题的根本原因。
像这样使用它:
w3wp.exe
进行过滤。希望出现的列表中显示一些file not found
行。