Saturday, January 28, 2012

How to stop ASP.NET Development Server after stopping the solution.

When we run the very big solution, asp.net icon is still in system tray even after stopping that solution (ASP.NET Development Server is running behind scene). It is very tedious to close the icon one by one.  Don’t be worry. The way to solve is simple and we have to use macros in Visual Studio.


To create the macros, Open the Visual Studio and go to Tools Menu > Macros > Macros IDE, otherwise use short cut key Alt+F11. You see IDE as below.

Visual Studio Macros IDE
On Visual Studio Macros, go to MyMacros Project > EnvironmentEvent Module and create DebuggerEvents_OnEnterDesignMode event as below.
Private Sub DebuggerEvents_OnEnterDesignMode(ByVal Reason As EnvDTE.dbgEventReason) Handles DebuggerEvents.OnEnterDesignMode
        For Each p In System.Diagnostics.Process.GetProcesses
            If p.ProcessName.IndexOf("WebDev.WebServer40") > -1 Then
                p.Kill()
            End If
        Next
End Sub

That’s is all you have to do. Right now, you don’t need to worry about it. Just mouse over the asp.net icons.:)

2 comments:

  1. Thank you -this was very helpful. Gail

    ReplyDelete
  2. TechnoSoftwar having several years experience working with global customers, connecting our professionals to their business needs, as their IT Development & Support Partner. TechnoSoftwar having a team of dedicated and experienced softwares developers that works for your all business needs. TechnoSoftwar deals in web design and development, Customized ERPs, CRMs, Web & Mobile Applications, eCommerce platforms etc.

    ReplyDelete