[UWP]使用打包为.vsix的.dll时,找不到指定的模块异常 [英] [UWP]The specified module could not be found Exception when using .dll packaged as a .vsix

查看:69
本文介绍了[UWP]使用打包为.vsix的.dll时,找不到指定的模块异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Windows Phone 8应用移植到Windows 10.发现服务.我们有用C/C ++编写的本机SDK.我们将此SDK .dll打包为.vsix软件包.我们提供此.vsix扩展名以及 带有示例应用程序供开发人员参考.

我创建了这个.vsix包&安装它.然后,我将添加参考"在我的样本中选择此.vsix,以便将其添加为示例中的参考".所有这一切都很好. VS能够看到由我们的dll&我能 成功构建应用.

当我运行示例应用程序时出现问题.当样本尝试使用任何符号时,它会收到以下消息"找不到指定的模块"的异常. (来自HRESULT:0x8007007E的异常);空"

I am trying to port my Windows Phone 8 app to Windows 10. Our company provides music recognition & discovery services. We have our native SDK written in C/C++. We package this SDK .dll as a .vsix package. We provide this .vsix extension along with a sample application for developer's reference. 

I create this .vsix package & install it. I then "Add Reference" in my sample & select this .vsix so that it gets added as a Reference in the sample. All this is working fine. VS is able to see the symbols, exposed by our dll & I am able to build the app successfully.

The problem arises when I run the sample app. When sample tries to use any of the symbols, it gets an Exception with the following message "The specified module could not be found. (Exception from HRESULT:0x8007007E);null"

看起来VS能够在构建/编译时找到该dll,但在运行时无法使用它.
在这种情况下,VS将复制到.vsix扩展名中的dll复制到哪里?

我们曾经与WinPhone8解决方案采用相同的体系结构(将dll作为.vsix扩展名打包).过去都很好用.
任何帮助将不胜感激.

Looks like VS is able to find the dll during build/compile time but unable to use it during run time. 
Where does VS copy the dll which is packaged in a .vsix extension in this case?

We used to same architecture(package our dll as a .vsix extension) with WinPhone8 solution as well & it all used to work well.
Any help will be highly appreciated.

谢谢

Ganesh

推荐答案

Ganesh,

Hi Ganesh,

不确定如何添加.VSIX作为对WinPhone项目的引用. .vsix只不过是VS扩展的部署机制.本质上,它是一个带有清单和有效负载的.zip文件.我怀疑您的意思是您要添加对此的引用 sdk dll.

Not sure how you add a .VSIX as a reference to a WinPhone project. A .vsix is nothing more than a deployment mechanism for a VS extension. Essentially, it's a .zip file with a manifest and payload. I suspect you meant you are adding a reference to this sdk dll.

此外,仅因为您引用了程序集或dll,并不意味着它随应用程序一起部署.我怀疑您只需要通过将复制本地"设置为复制本地"来将程序集复制到同一目录即可.装配参考上的属性 变为真实.

Additionally, just because you reference an assembly or dll, doesn't mean it gets deployed with your application. I suspect you just need to copy the assembly to the same directory by setting the "Copy Local" property on the assembly reference to true.

此致


这篇关于[UWP]使用打包为.vsix的.dll时,找不到指定的模块异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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