VSIX扩展-更改DLL的路径 [英] VSIX extension - Change Path of DLL

查看:200
本文介绍了VSIX扩展-更改DLL的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Visual Studio 2013创建了Visual Studio扩展(VSIX). 在此扩展中,我引用了我创建的另一个类库(DLL).

I've created a Visual Studio Extension (VSIX) with Visual Studio 2013. In this extension I have a reference to another class library (DLL) which I created.

此DLL在安装扩展程序后将正确放置在扩展程序文件夹中 扩展文件夹为C:\ Users \ username \ AppData \ Local \ Microsoft \ VisualStudio \ 12.0 \ Extensions \ 1oqfh4o4.2y5 \

This DLL will be placed in the extension Folder correctly after installing the extension Extension Folder is C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\1oqfh4o4.2y5\

但是我在Visual Studio的安装目录中也需要此dll-> C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Common7 \ IDE

But I need this dll also in the installing directory of the Visual Studio -> C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE

如果我不将dll复制到Visual Studio文件夹中,则会出现扩展名找不到dll的异常.

If I do not copy the dll into the Visual Studio folder I get an exception that the extension cannot find the dll.

是否可以将dll的路径更改为扩展文件夹? 是否可以将dll直接包含到VSIX中?

Is it possible to change the path of the dll to the extension folder? Is it possible to include the dll directly to the VSIX?

我在"source.extension.vsixmanifest"中使用资产"进行了尝试,但是仍然无法正常工作.

I tried it with the "Assets" in the "source.extension.vsixmanifest" but it's still not working.

我对外部库"System.Windows.Interactivity.dll"也遇到相同的问题

I also have the same problem with an external library "System.Windows.Interactivity.dll"

谢谢,菲尔

推荐答案

是否可以将dll直接包含到VSIX中?

Is it possible to include the dll directly to the VSIX?

是,但是您应该确保该dll可重新分发.

Yes, but you should make sure that the dll is redistributable.

  • 将dll作为文件而不是文件添加到扩展项目中 参考(添加->现有项目).
  • 在属性"窗口中将其属性"构建操作"设置为内容.
  • 在属性"窗口上将其属性"包含在VSIX中"设置为 True .
  • Add the dll to your extension project as file instead of reference(Add->Existing Item).
  • Set its property "Build action" to Content on the Properties window.
  • Set its property "Include in VSIX" to True on the Properties window.

然后构建扩展项目,您可以检查.vsix文件中的dll文件(将.vsix文件重命名为.vsix.zip文件并打开以进行检查).

Then build the extension project, you can check the dll file in the .vsix file (Rename the .vsix file to .vsix.zip file and open it to check).

这篇关于VSIX扩展-更改DLL的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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