XBAP部署的Win32 DLL [英] Deploying XBAP with win32 DLL

查看:261
本文介绍了XBAP部署的Win32 DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的XBAP应用程序使用两个Win32的DLL和往常一样多的.Net的DLL。因为我们添加到项目本身的.NET引用,这不是一个问题,因为他们都得到出版项目时自动部署;只是他们的名字从 mydotnet.dll 更改为 mydotnet.dll.deploy

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.

但问题是,在Win32 DLL文件没有得到部署,既不是他们的名字更改。我明白其中的道理。这是因为我使用P / Invoke技术给他们打电话,他们正在不添加到项目中。事实上,Visual Studio 2010中并不让我把它们添加到引用。所以我手动将其复制到发布文件夹,并试图尝试是否可行。但它没有工作。错误的浏览器显示,是这样的:

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:无法
加载DLL Player.dll':本指定
模块找不到。

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

在Player.PlayerProxy.Initialize()结果
atRunaware.WpfBrowserApp.Player.Page1.PlayFile:(0x8007007E从HRESULT异常
) (对象
发件人,RoutedEventArgs E)

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?

以前我试图做什么,我想在Silverlight做的,但的奥斯汀建议我使用XBAP来实现同样的事情。网址前面的话题:

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:

处理Silverlight的用户控件

推荐答案

您可以试试:


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

  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.

尝试包括的DLL与副本设置为始终复制输出目录中的项目内容文件(我认为这可能会使他们出现在第1点提及的参考文献列表,让您将其设置为包含)。

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").

这篇关于XBAP部署的Win32 DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆