Including batch file with VSIX

I am trying to create a Visual Studio plugin, it is a menu item that executes batch files. I do not know how to include batch files (or any other additional files) on VSIX when publishing, so that they are accessible to all users who install the extension.

+5
source share
2 answers

In the solution explorer, right-click on the batch file (in this case I named it BatchFile.cmd) and select "Properties"

In the properties window, change:

Build Action: Content

Enable on VSIX: True

When the solution is built in release mode, it creates a VSIX file in the bin / Release folder. This is a package and contains all the necessary assets. When the package is installed on another computer, the package file enters the installation location and can be specified using:

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

+11
source

You can simply include the batch file as content in your project and use GetAssembly () to find the location of your adin dll at runtime

+2
source

Source: https://habr.com/ru/post/1202343/


All Articles