I have a Visual Studio package that does some of its work by starting an external process (using System.Diagnostics.Process
) and communicating with it over standard input/output. Currently, I have the path to the .exe
hard-coded which is obviously not workable for actually deploying the extension. What is the right way to package and distribute the .exe
with the extension? (And, related, once I have done so, how do I programmatically discover the path to the installed .exe
file.) Preferably I would like to put it into the .vsix
file so installation is easy.
EDIT: I have placed the relevant part of my code on BitBucket (it may be useful to someone else using Roslyn): roslyn_process in order to give a better idea of what I am trying to do. This code sets up communication between a Visual Studio extension using an implementation of AbstractProcessHandler
and a separate process using RoslynProcess
. The latter is kept informed of modifications to the code files in Visual Studio and which code file is being viewed, so it is able to do analysis with up-to-date information despite not running as a Visual Studio extension which would impose the limitations of Roslyn on all code being edited.
EDIT 2: Using this answer, I can get the directory of the extension. I can include another package in source.extension.vsixmanifest
by adding it to the content list as type "Custom Extension Type". Then the .exe
appears in the extension's directory. This seems like it's probably the right solution although the way of getting the directory is labeled in MSDN as something I shouldn't be using.
It seems like this might be the best way to do this even though it seems hackish, in which case I'll post this as an answer once I get everything working.