Exception from HRESULT: 0x800736B1

[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

转载于:https://www.cnblogs.com/wangrsh2010/archive/2011/06/24/2088612.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值