使用 win32 DLL 部署 XBAP

发布于 2024-10-13 08:38:12 字数 909 浏览 4 评论 0原文

我的 XBAP 应用程序使用两个 win32 dll,并且像往常一样使用许多 .Net dll。由于我们添加了对项目本身的 .net 引用,所以这不是问题,因为它们都会在发布项目时自动部署;只是它们的名称从 mydotnet.dll 更改为 mydotnet.dll.deploy

但问题是,win32 dll 没有部署,它们的名称也没有改变。我明白其中的原因。这是因为我使用 p/invoke 技术调用它们,并且它们没有添加到项目中。事实上,Visual Studio 2010 不允许我将它们添加到引用中。因此,我手动将它们复制到发布文件夹,并尝试尝试是否有效。但这没有用。浏览器显示的错误是这样的:

System.DllNotFoundException:无法 加载 DLL 'Player.dll': 指定 找不到模块。 (例外 来自 HRESULT:0x8007007E)

在 Player.PlayerProxy.Initialize()
atRunaware.WpfBrowserApp.Player.Page1.PlayFile(对象 发送者、RoatedEventArgs e)

谁能解释一下发生了什么?有什么解决办法吗?


以前我试图在 Silverlight 中做我想做的事情,但是 Austin 建议我使用 XBAP 来实现同样的事情。上一主题的 URL:

Silverlight UserControl 句柄

My XBAP application uses two win32 dlls and as usual many .Net dlls. Since we add .net references to the project itself, that is not a problem, as they all get deployed automatically when publishing the project; only that their names change from mydotnet.dll to mydotnet.dll.deploy.

But the problem is, the win32 dlls don't get deployed, neither their names change. And I understand the reason. It's because I call them using p/invoke techniques, and they're not added to the project. In fact, visual studio 2010 doesn't let me add them to the references. So I manually copied them to the publish-folder, and tried experimenting if that works. But it didn't work. The error the browser shows, is this:

System.DllNotFoundException: Unable to
load DLL 'Player.dll': The specified
module could not be found. (Exception
from HRESULT: 0x8007007E)

at Player.PlayerProxy.Initialize()
atRunaware.WpfBrowserApp.Player.Page1.PlayFile(Object
sender, RoutedEventArgs e)

Can anyone explain me what is going on? And any solution for that?


Previously I was trying to do what I want to do in Silverlight, but Austin suggested me to use XBAP to achieve the same thing. URL to the previous topic:

Handle to Silverlight UserControl

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

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

发布评论

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

评论(1

活雷疯 2024-10-20 08:38:12

您可以尝试:

  1. 检查“发布”下的项目属性 >应用程序文件部分,如果您的本机 dll 出现在那里,请确保将它们设置为包含。

  2. 尝试将 dll 作为内容文件包含在项目中,并将“复制到输出目录”设置为“始终复制”(我认为这可能会使它们出现在第 1 点提到的引用列表中,允许您将它们设置为“包含” )。

Can you try:

  1. Checking your project properties under the Publish > Application Files section and if your native dlls appear there, making sure they are set to include.

  2. Try including the dlls as content files in your project with copy to output directory set to Copy Always (I would think this may make them appear in the list of references mentioned in point 1, allowing you to set them to "Include").

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