Keyboard shortcut to attach to w3wp.exe in VS11

后端 未结 6 613
渐次进展
渐次进展 2021-01-30 07:19

Since VS11 removed macros, I can no longer fire this macro to attach to the webserver using a keyboard shortcut.

Is there another way to start the debugger and attach to

相关标签:
6条回答
  • 2021-01-30 07:21

    The debugger in visual studio automatically attaches to the web server if you check that box in the project properties. A macro has never been necessary for that.

    Check the "Use Local IIS Web server" box in Visual Studio, on the "Web" tab of your project properties. Then check the "ASP.NET" box at the bottom, under "Debuggers"

    To debug, just hit F5.

    EDIT

    To get F5 to simply attach to w3wp.exe...

    Make sure you have a web project set as the StartUp project enter image description here

    On that web project's settings Web tab, just select "Use Local IIS Web server" and put in the url you use to go to your site (the url really only matters if you keep the Start Action on "Current Page"). I don't like having a browser get launched, because there's a good chance I'm actually on another site in the project. But what's great is once it attaches to w3wp.exe, it'll be debugging any site. enter image description here

    0 讨论(0)
  • 2021-01-30 07:23

    In VS12 i just added my own shortcut because the default doesn't appear to be there.

    CRTL+Shift+ALT+D

    For web apps, I usually follow that with a w and enter. Enter is the big key by your right pinky.

    0 讨论(0)
  • 2021-01-30 07:34

    Sad that macros were removed in VS 2012, but you can use hotkeys :)

    Ctrl+Alt+P Press w (should find first one which in 99% is w3wp) Press Enter OK

    0 讨论(0)
  • 2021-01-30 07:36

    Since the AttachTo extension is not supported by vs 2015, I suggest another one: ReAttach.

    0 讨论(0)
  • 2021-01-30 07:38

    Install AttachTo extension, and bind the shortcut key to Tools.AttachToIIS.

    0 讨论(0)
  • 2021-01-30 07:38

    In response to Cory's answer, you don't need to create your own shortcut. CTRL+ALT+P opens the attach to process dialog, then you can use his suggestion and type "w" to find the IIS process in the list.

    This is also useful if you are remote debugging and therefore don't have a local process to attach to automatically.

    If you are working with IIS on your local machine, then you can set it up as a local IIS web server or Custom Web Server in the "Web" tab of your project's properties.

    0 讨论(0)
提交回复
热议问题