title: Hold the console window open using c#
body: <p>I have the below code to build a project using MSBuild:</p>
  
  <pre><code>string process = sourcePath + @"\Application.sln /t:rebuild";
  System.Diagnostics.Process csc = System.Diagnostics.Process.Start(@"C:\WINNT\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe",process);
  </code></pre>
  
  <p>This code worked before, I don't know why is not working any more.</p>
  
  <p>If I do the same thing above by CMD it works fine, but not from VS.Net, the console window disappear fast so I can't see the error message.</p>
  
  <p>If I debug the code I got this:
  <code>BasePriority = 'csc.BasePriority' threw an exception of type 'System.InvalidOperationException'</code></p>
  
  <p>Is there any way to hold that screen so I can know what is happening here?</p>