无法在某些 PC 上运行 c#application(使用 c++ dll) [英] Unable to run c#application (using c++ dll) in some PCs

查看:32
本文介绍了无法在某些 PC 上运行 c#application(使用 c++ dll)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建了一个调用 c++ dll(sdbm.dll) 的 c# 应用程序.除了某些 PC 外,它在大多数 PC 上都可以正常工作.dll是使用VC++ 2008创建的,应用程序是在VC#2005中完成的.以下是从C#应用程序调用dll函数时发生的错误.

we have created a c# application which calls a c++ dll(sdbm.dll). It is working properly in most of the PCs except some PCs. The dll is created using VC++ 2008 and application is done in VC# 2005. Following are the errors occured when the dll functions are called from the C# application.

一台电脑出现的错误如下

Error occured in one PC is as follows

======================================

=====================================

无法加载 sdbm.dll:此应用程序无法启动,因为应用程序配置不正确.重新安装应用程序可能会解决此问题(来自 HRESULT 的异常:0x800736B1)

Unable to load sdbm.dll :This application has failed to start because the application configuration is incorrect.Reinstalling the application may fix this problem (Exception from HRESULT :0x800736B1)

第二台电脑出现错误

======================================

=====================================

错误签名

Appname:app.exe Appver:1.0.0.0 Modname:msvcr90.dll Modver:9.0.30729.4148 Offset:0002fc96

Appname:app.exe Appver:1.0.0.0 Modname:msvcr90.dll Modver:9.0.30729.4148 Offset:0002fc96

任何帮助将不胜感激

推荐答案

正如其他人在他们的评论中已经指出的,这似乎是您的 sdbm.dll 依赖项的问题.找出根本原因的最简单方法,您应该获取 DependencyWalker 的副本并将您的 sdbm.dll 放入其中.首先在没有任何问题的机器上运行,然后在其中一台有问题的机器上启动 DependencyWalker 以查看它的输出.

As the others already stated in their comment it seems to be a problem with the dependencies of your sdbm.dll. The simplest way to find out the root cause you should get a copy of DependencyWalker and throw your sdbm.dll into it. First on a machine where it runs without any problems and afterwards start DependencyWalker on one of the problematic machines to see it's output.

它为您提供了一些有关在当前机器上找不到的 DLL 的信息.这将您带到有问题的库中.

It gives you some informations about what DLLs it couldn't found on the current machine. Thous leading you to the problematic libraries.

几乎总是问题在于缺少 Visual C++ Redistributable Package (2005 年20082010) 或者您的库已编译并部署为调试版本.在这种情况下,它将链接到例如的调试版本mfcxx.dll 使用 mfcxxd.dll.但是这些调试版本只安装了相应的SDK(或Visual Studio),而不是再分发包.从而导致在用户机器上出现问题,而不是在开发者机器上出现问题.

Nearly always the problem is a missing Visual C++ Redistributable Package (2005, 2008, 2010) or that your library is compiled and deployed as debug version. In this case it will link to the debug versions of e.g. mfcxx.dll by using the mfcxxd.dll. But these debug versions are only installed with the corresponding SDK (or Visual Studio) and not with the redistribution package. Thus leading to problem on the user machine but not no a developer machine.

这篇关于无法在某些 PC 上运行 c#application(使用 c++ dll)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆