public static void Attach() { // Get an instance of the currently running Visual Studio IDE. DTE2 dte2; dte2 = (DTE2)System.Runtime.InteropServices.Marshal. GetActiveObject("VisualStudio.DTE.10.0"); var pa = new ProcessAttacher(dte2, "iisexpress", 20); pa.OptimisticAttachManaged(); }
public static void Attach() { DTE2 dte2; dte2 = (DTE2) Marshal. GetActiveObject("VisualStudio.DTE.10.0"); var pa = new ProcessAttacher(dte2, "iisexpress", 10); pa.PessimisticAttachManaged(); return; // Get an instance of the currently running Visual Studio IDE. }
public static void Attach() { DTE2 dte2; try { dte2 = (DTE2)Marshal.GetActiveObject("VisualStudio.DTE.10.0"); } catch (Exception e) { dte2 = (DTE2)Marshal.GetActiveObject("VisualStudio.DTE.11.0"); } var pa = new ProcessAttacher(dte2, "iisexpress", 10); pa.PessimisticAttachManaged(); // Get an instance of the currently running Visual Studio IDE. }