jjzjj

C# Dll 导入失败 : "The application has failed to start because its side-by-side configuration is incorrect"

coder 2024-02-01 原文

我有一个 c# .net 4 应用程序,使用 vs 2010。 我正在尝试导入一个 c++ dll(基于 vs 2005)。

 [DllImport("Card.dll")]

我得到了失败:

Unable to load DLL 'Card.dll': The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)

使用 sxstrace.exe 我得到:

ERROR: Cannot resolve reference Microsoft.VC80.DebugMFC,processorArchitecture="x86"

我还发现:

MFC80D.DLL and MSVCR80D.DLL are missing

请注意,这不是 DebugCRT,因为此问题是由使用 Debug 编译的 DLL 而不是 Release 引起的。我现在用的是Release编译的dll,问题是DebugMFC。

我已经尝试了所有我能在网上找到的东西。为了节省时间,我将介绍我尝试过的东西,所以我不会再收到这样的建议:

1- 我已经安装了 Microsoft Visual C++ 2010 Redistributable Package + SP1 + 安全更新

2- 我已经安装了 Microsoft Visual C++ 2008 Redistributable Package

3 - 我已经安装了 Microsoft Visual C++ 2005 Redistributable Package

4 - 我尝试将此应用程序作为“发布”而非“调试”运行

5 - 我尝试将 entryPoint 设置为 DllImport

没有帮助。我仍然遇到同样的错误。除了上面列出的建议,我没有在网上看到任何其他建议。 谁能帮帮我?

最佳答案

因为它说“无法解析引用 Microsoft.VC80.DebugCRT,processorArchitecture="x86”,这意味着您缺少对 VC 8.0 调试 crt 运行时的依赖。这意味着您需要构建一个版本,而不是调试, card.dll 的版本。Microsoft 不提供用于调试 CRT 运行时的可再发行包。那些只随 visual studio 一起提供。因此构建 card.dll 的发布版本,这应该对您的情况有所帮助。

关于C# Dll 导入失败 : "The application has failed to start because its side-by-side configuration is incorrect",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12337909/

有关C# Dll 导入失败 : "The application has failed to start because its side-by-side configuration is incorrect"的更多相关文章

随机推荐