gpt4 book ai didi

c# - 没有 VS 2008 的 system.dllnotfoundexception

转载 作者:行者123 更新时间:2023-11-28 07:37:47 24 4
gpt4 key购买 nike

我的 C# 代码加载了一个 C++ DLL。它在我安装了 Visual Studio 2008 的 PC 上运行良好。但是在其他机器上程序异常停止

Unhandeled exception: system.dllnotfoundexception unable to load dll ... 
this application has failed becasue the application configuration is incorrect....

如何让这段代码在没有安装 VS 2008 的机器上运行?

最佳答案

如果您的 DLL 是您的自定义 DLL,则必须将您的 DLL 与您的项目一起分发。如果没有,您必须使用自定义安装程序安装所需的 DLL,或者如果它来自不同的提供商,则使用它们的安装程序。

This帖子可能有点旧,但是

DLL 文件和 .NET ClickOnce 部署

我想将我的一个 .NET 应用程序部署为 ClickOnce 应用程序。问题是我正在连接到 Oracle(请参阅此处和此处以前的帖子)。连接到 Oracle 至少需要 4 个 DLL 文件,这些文件通常必须与 EXE 文件位于同一目录中。问题是程序发布时,没有以任何方式引用 DLL,因此程序无法运行。

然后我阅读了有关将文件添加到项目的信息,以便 ClickOnce 和发布处理器确定需要 DLL 并将它们添加到 list 中。

Here is the process in Visual Studio 2005:  
1. Put the 4 DLL files in their own directory in your solution directory (for ease of use mostly).
2. Add all four files to your project by going to “Project->Add Existing Item…”
3. Click on each DLL file in the solution explorer and then change their property: “Copy To Output Directory” to “Copy Always”.

就是这样!现在,当我发布甚至运行应用程序时,我不必担心 DLL 文件是否在它们应该在的位置。

关于c# - 没有 VS 2008 的 system.dllnotfoundexception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16398504/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com