Visual Studio add-in for automatic connection to the development server

Does anyone know about a Visual Studio 2010 add-in that will automatically let you connect to a running instance of ASP.Net Development Server? And if more than one is currently running, display a quick dialog that allows you to select from the list only ASP.Net development servers that are running?

Why do I need it? <- feel free to skip this part.

As usual, I develop / debug web applications, you launch the browser and browse the application until I get to the page I need (there may be many pages in depth.) I donโ€™t want the debugger to connect through these steps for various reasons (this is slower than the lack of binding, extraneous break points may be deleted, maybe I may have a break when "thrown" is turned on and doesnโ€™t want to break earlier in the application when processing errors, etc. ..)

I go to the page I want, and then use the Visual Studio menu for Debug> Attach to Process, and then from the Attach to Process dialog box, I need to scroll all the way down (pages and pages and process pages) until I find the WebDev process. WebServer40.EXE, which I want, and select this.

Doing this makes me take my hands off the keyboard and use the mouse (which I usually try to avoid).

And doing it seems unnecessarily repetitive, because if I debug an ASP.Net web application, I always want to connect to an instance of WebDev.WebServer40.exe.

+8
visual-studio-2010 web-development-server
source share
3 answers

I prefer to do the same, and IS can connect all this with a key press with a macro.

Go to Tools> Macros> Macro IDE

Add a new module and use this code (funky comments for syntax highlighting)

Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE90a Imports EnvDTE100 Imports System.Diagnostics Imports System.Collections.Generic Public Module AttachingModule Sub AttachToAspNET() Try Dim process As EnvDTE.Process Dim listProcess As New List(Of String) '' // uncomment the processes that you'd like to attach to. I only attach to cassini '' // listProcess.Add("aspnet_wp.exe") '' // listProcess.Add("w3wp.exe") listProcess.Add("webdev.webserver") For Each process In DTE.Debugger.LocalProcesses For Each procname As String In listProcess If process.Name.ToLower.IndexOf(procname) <> -1 Then process.Attach() End If Next Next Catch ex As System.Exception MsgBox(ex.Message) End Try End Sub End Module 

Click File> Close and return

Click Tools> Options

Click Environment> Keyboard

I put the macro in MyMacros, so I'm looking for "Macros .MyMacros.AttachingModule.AttachToAspNET" in "Show commands containing a" text box ".

I prefer to use Ctrl + Alt + D , but put whatever you want in the "Press shortcut keys" text box and click "Assign", then "OK"

Now you only need to press Ctrl + Alt + D to connect to all instances of cassini.

I saw various variations of this on the internet, and this was the last thing I found. I had to modify this a bit to remove additional web processes and abandon the .exe from WebDev.WebServer.exe so that it could debug instances of cassini.net 4.0.

+7
source share

I donโ€™t know of any such add-on, but you can easily connect to the process using keyboard shortcuts and pressing "W" to go to the WebDev process.

Ctrl + Alt + P - Attach to the process
(the process window now has focus)
Press W , which jumps to processes starting with W Press Enter to add

Not an addition, but you can do it without touching the mouse.

+4
source share

Mark this answer: Join the process in 2012

This is a simple plugin that provides shortcuts for joining the nunit, IIS, and IIS Express agent. Its pure convenience compared to Ctrl-Alt-P, but it is convenient.

Direct link to the plugin here

+1
source share

All Articles