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.
Including a batch file with VSIX
Asked Answered
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"
Thanks, it's a good one. What I like about it is that you can add the item as a link to the project and it will still get packaged in vsix. –
Bombshell
You can just include the batch file as content in your project, and use GetAssembly() to find the location of your adin dll at runtime
© 2022 - 2024 — McMap. All rights reserved.