登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

秒大刀 博客

好好学习 天天向上

 
 
 

日志

 
 
 
 

Exception from HRESULT: 0x800736B1  

2008-03-11 23:09:52|  分类: C# |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

[Exception]  Unable to load DLL 'zlibdll.dll': 由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。 (Exception from HRESULT: 0x800736B1)
[Message]    System.DllNotFoundException

        zlibdll是我对C++ zlib项目的包装,采用P/Invoke方式在.net下调用,一直工作的很好。但在某些机器上会报出上面的错误。出现这个问题并不一定是我的zlibdll.dll有问题,可能是我的dll的以来库有问题。用Dependency Walker看了下,发现可疑依赖项有两个:msvcr80.dll[8.0.50727.1433]和msvcrt.dll[7.0.2600.2180]。为避免平台问题,我将这两个文件也打包一起发行,但很遗憾并没有解决所有的问题,还是有一些机器会出问题。

C++/CLI dll will not load in C# project(Exception from HRESULT: 0x800736B1)

I had the same problem until today (Exception from HRESULT: 0x800736B1).

In my develop. box everything worked fine, but in the test machine that errors appears when a C# app called a DLL compiled with MSVC++2005.

After reading the msdn documentation, this forum and other helpfull sites, I managed to fix it. Maybe this could help someone in the same situation.

1) Install vcredist_x86.exe in the customer/test/deployment machine. It can be found on \Program Files\Microsoft Visual Studio8\Sdk\v2.0BootStrapper\Packages\vcredist_x86

2) Make sure you are using the dll′s RELEASE version. For some reason the dll′s DEBUG version keep getting the same error. (Maybe the MSVC++ 2005 redist does not install the DEBUG required files such as Microsoft.VC80.DebugCRT, didn′t check this, just a thought).

With these two steps I′ve done it. Also you can check if your DLL has the Manifest embedded. Look inside the DLL with a bin editor/reader and look for the xml file with manifestVersion string. If the manifest is not embedded, check for the file in your output dir, something like yourdll.manifest and use the mt.exe tool from the bin dir of vc to include it inside the dll.

System.IO.FileLoadException

Unhandled Exception: System.IO.FileLoadException: Could not load file or assemby 'ACME.PGP, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

File name: 'ACME.PGP, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' --->

 System.Runtime.InteropServices.COMException (0x800736B1): This application has

failed to start because the application configuration is incorrect. Reinstalling

 the application may fix this problem. (Exception from HRESULT: 0x800736B1) 

The issue was resolved. I needed the Visual 2005 SP1 CRT library installed. This is part of the Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)

It can be downloaded from http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

 

问题现在很清楚了,是VC2005 sp1的运行库问题,这个确实是一个不怎么友好的bug,微软很应该在发行新的程序员平台时随自动更新去安装决大多数的最常用的支持环境。抓住了程序员才能抓住整个市场!

  评论这张
 
阅读(12625)| 评论(2)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018