visual_studio_macros

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
visual_studio_macros [2009/03/08 21:18] – created stephenvisual_studio_macros [2017/01/01 20:05] (current) – external edit 127.0.0.1
Line 130: Line 130:
 </code> </code>
  
 +===== Kill ASP.Net Worker Process =====
 +
 +<code vb>
 +    Sub KillAspNetWorkerProcess()
 +        Dim objProcess As System.Diagnostics.Process
 +
 +        DTE.StatusBar.Text = "Gathering system process information."
 +
 +        For Each objProcess In System.Diagnostics.Process.GetProcessesByName("aspnet_wp")
 +            If Not objProcess.HasExited Then
 +                Try
 +                    DTE.StatusBar.Text = "Killing process " + objProcess.Id.ToString()
 +
 +                    objProcess.Kill()
 +
 +                Catch ex As System.Threading.ThreadAbortException
 +                    ' Just ignore it.
 +                End Try
 +            End If
 +        Next
 +
 +        DTE.StatusBar.Text = "ASP.Net worker process killed."
 +
 +    End Sub
 +
 +</code>
  
 {{tag>reference code_snippet archived}} {{tag>reference code_snippet archived}}
visual_studio_macros.1236547091.txt.gz · Last modified: 2017/01/01 19:55 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki