I'm playing about with an addin to Visual Studio 2005 that calls an external process.
When I run the code outside of the addin - i.e. in a standalone project it works fine. However when I call it as part of a addin the Process.Start() call is made but then nothing happens, the subsequent lines of code are never reached.
I have tried running VS with standard and elevated priviliges but get the same effect.
The code is below - it is called when clicking on a custom menu item:
string documentPath = @"C:\TestCode\TestApp\Testform.cs";
string folder = Path.GetDirectoryName(@"C:\TestCode\TestApp\");
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "notepad.exe";
p.StartInfo.Arguments = documentPath;
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
string output = p.StandardOutput.ReadToEnd();
I've tried different executables, but this does not make any difference. Am I going about this the wrong way in VS? Any help is appreciated.