Package .exe in .vsix and call from Visual Studio extension

I have a Visual Studio package that does part of its work by starting an external process (using System.Diagnostics.Process) and communicating with it through standard input / output. I currently have a path to hard coding .exe, which obviously does not work for the actual expansion deployment. What is the correct way to pack and distribute .exewith the extension? (And by contacting, as soon as I did, how I programmatically detect the path to the installed file .exe.) I would like to put it in the file .vsix, so the installation is simple.

EDIT: I put the appropriate part of my code on BitBucket (this might be useful to someone else using Roslyn): roslyn_process to better understand what I'm trying to do. This code establishes a relationship between a Visual Studio extension using an implementation AbstractProcessHandlerand a separate process using RoslynProcess. The latter reports changes to the code files in Visual Studio and which code file is viewed, so it can analyze with updated information, although it does not work as a Visual Studio extension that would impose Roslyn restrictions when editing all the code.

EDIT 2: Using this answer , I can get the extension directory. I can include another package in source.extension.vsixmanifestby adding it to the content list as the type "Custom Extension Type". Then .exeappears in the extension directory. This seems like it is probably the right solution, although the way to get the directory is marked on MSDN as something that I should not use.

It seems that this may be the best way to do this, although it seems hacky, in which case I will send it as an answer as soon as I get everything that works.

+5
source share
1 answer

, DLL EXE ( EXE) . :

typeof(ExternalProcess).Assembly.Location

EXE .

- VSIX EXE VSIX , . .vsixmanifest EXE.

+5

All Articles