vs2008发布非托管dll问题

发布于 2024-07-09 11:34:22 字数 321 浏览 3 评论 0原文

我有一组非托管 dll,它们周围有一个 C# 包装器,我从 C# 项目调用它们。 我添加了一个构建事件行,如下所示:

mkdir ..\Release
mkdir ..\Debug
copy ..\..\Includes\*.dll ..\Release\*.dll
copy ..\..\Includes\*.dll ..\Debug\*.dll

问题是,当我发布应用程序时,这些 dll 不包含在内,并且该发布比无用更糟糕,因为它创建了一个运行的应用程序,直到您调用其中之一那些dll。

那么,当我发布项目时如何包含非托管dll呢?

I have a collection of unmanaged dlls with a C# wrapper around them that I'm calling from a C# project. I've added a build event line that looks like:

mkdir ..\Release
mkdir ..\Debug
copy ..\..\Includes\*.dll ..\Release\*.dll
copy ..\..\Includes\*.dll ..\Debug\*.dll

Problem is, when I go to publish the application, those dlls aren't included, and the publication is worse than useless, since it creates an application that runs until you call one of those dlls.

So, how do I include unmanaged dlls when I publish the project?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

森林迷了鹿 2024-07-16 11:34:23

答案是:不要发布此内容,而是使用 Windows 安装程序, 如此处所述。

And the answer is: don't publish this, use the windows installer instead, as described here.

网名女生简单气质 2024-07-16 11:34:23

我目前正在调查同样的问题。 关于这个主题的文献确实非常少!

我能看到的唯一解决方案是将非托管 DLL 作为嵌入资源嵌入到程序集中,并在调用任何函数之前以编程方式将其提取到执行路径。

I'm currently investigating the same issue. The literature on the topic is very sparse indeed!

The only solution I can see is to embed the unmanaged DLL as an embedded resource inside the assembly, and programatically extract it out to the executing path before calling any functions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文