I developed a visual studio package plugin and today I need to implement the attach to iisexpress in C#.
My plugin builds the project of active document in visual studio editor from a button in context menu, and in the end of the routine, I need to attach it.
I've researched and found it:
System.Diagnostics.Debugger.Launch();
But when this code is executed, Visual Studio freezes and shutdown.
Before this code, I try to find the iisexpress process by:
var IsIisRunning = System.Diagnostics.Process.GetProcessesByName("iisexpress");
if (IsIisRunning.Length == 0)
return;
So I know the process exists.
Am I forgetting something?
Somebody can help me?
Thanks for your time.
I solve the problem using ENVDTE80.Process2 object as follows: