c# - process.start() hangs when called from VS Addin -
I am playing with Edin in Visual Studio 2005, which calls the external process.
When I run code outside of Edin - that means it works fine in a standalone project. However, when I call it as part of an addin process. Start () is called, but then nothing happens, the next line of code never reaches.
I have tried to run VS with standard and high privileges but get the same effect.
The code is below - it's called when clicking on the custom menu item:
string document path = @ "C: \ TestCoda \ test-test". " String folder = path.gate directory name (@ "c: \ testcoda \ test app"); 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 have tried various executives, but it does not make any difference whether I am VS. I am going wrong? Any help is appreciated.
Have you tried / caught it? There are many numbers related to the path / current directory, especially working with the VS extension (but I expect notepad to work at least).
I also do not know what to expect of that code (in the context of stdout of notepad.exe); Can you please clarify?
There is no issue at the moment, but note that when you have to work in the form of logic with paths, then you would like to add quotation from the beginning - that is why
P. StartInfo.Arguments = "\" "+ documentPath +" \ "";
(if there is an empty space in the path)
Comments
Post a Comment