包含VSIX的批处理文件 [英] Including a batch file with VSIX

查看:164
本文介绍了包含VSIX的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个Visual Studio插件,它是一个执行批处理文件的菜单项。我不知道如何在发布时将这些批处理文件(或任何其他文件)包含在VSIX中,以便它们可供所有安装该扩展的用户使用。

解决方案

在解决方案资源管理器中,右键单击批处理文件(在这种情况下,我将其称为BatchFile.cmd),然后选择属性



在属性窗口中更改:
$ b 构建操作:内容

包含在VSIX中: True

当解决方案构建在release模式下时,它会在bin / Release文件夹中创建一个VSIX文件。这是包,它包含所有需要的资产。在另一台机器上安装软件包时,批处理文件将包含在安装位置中,并可以使用以下命令引用:
$ b $ p Path.GetDirectoryName(Assembly.GetExecutingAssembly()。 )+ BatchFile.cmd


I'm trying to create a Visual Studio plugin, it's a menu item that executes batch files. I have no idea how to include the batch files (or any other additional files) with the VSIX when publishing so that they are available to all users that install the extension.

解决方案

In solution explorer right click on the batch file (in this case I called it BatchFile.cmd) and choose 'Properties'

In the properties window change:

Build Action: Content

Include in VSIX: True

When the solution is built in release mode it creates a VSIX file in the bin/Release folder. This is the package and it contains all the assets required. When the package is installed on another machine, the batch file is included in the install location and can be referenced using:

Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "BatchFile.cmd"

这篇关于包含VSIX的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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