使用 win32 DLL 部署 XBAP
我的 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:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试:
检查“发布”下的项目属性 >应用程序文件部分,如果您的本机 dll 出现在那里,请确保将它们设置为包含。
尝试将 dll 作为内容文件包含在项目中,并将“复制到输出目录”设置为“始终复制”(我认为这可能会使它们出现在第 1 点提到的引用列表中,允许您将它们设置为“包含” )。
Can you try:
Checking your project properties under the Publish > Application Files section and if your native dlls appear there, making sure they are set to include.
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").