admin 发表于 2019-6-5 17:26:11

未能加载文件或程序集“ManagedZLib.DLL”或它的某一个依赖项。(异常来自 HRESULT:...

在从2003系统迁移一个.net开发站点到2012系统上后,打开提示如下信息:未能加载文件或程序集“ManagedZLib.DLL”或它的某一个依赖项。找不到指定的模块。   在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)   在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)   在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)   在 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)   在 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)   在 System.Reflection.Assembly.Load(String assemblyString)   在 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)提示"未能加载文件或程序集或它的某一个依赖项”
错误信息已经很明显了,即:不能加载这个DLL模块或者该模块依赖的DLL模块。这种情况我们分两种排查:
[*]加载的DLL是否存在。对于.net的站点,一般在站点bin目录。可以直接查看bin目录下是否存在该dll


[*]DLL存在,则考虑其依赖或权限。如果提示拒绝访问,考虑给IIS程序池账户的执行权限。提示找不到指定模块,则一般为依赖项未解决导致。


我这里为提示“找不到指定的模块”,故,考虑依赖。windows下依赖一般都是运行库问题。查看程序为小蚂蚁程序,在安装说明里说需要“MFC42D.DLL、msvcrtd.dll、MSVCP60D.DLL”几个MFC的运行库。查看我的服务器系统目录(C:\windows\system32)下MFC的运行库已经存在,说明不是这个我问题。由于这里提示加载错误的dll为“ManagedZlib.dll”,考虑从这个dll的依赖入手。经过查询,找到这个文章:https://social.msdn.microsoft.com/Forums/vstudio/en-US/406f32a7-fd22-4a44-9dee-0c5e115328d4/managedzlibdll-windows-server-2008-r2
页: [1]
查看完整版本: 未能加载文件或程序集“ManagedZLib.DLL”或它的某一个依赖项。(异常来自 HRESULT:...