Attach Debugger to IIS instance

C#asp.netVisual Studio-2005Debugging

C# Problem Overview


I have IIS 5.1 on a XP machine, and visual studio 2005. How do I go about attaching my debugger to IIS instance.

BTW: I'm not seeing the IIS process within the running processes or probably I don't know what to look for .

C# Solutions


Solution 1 - C#

In Visual Studio:

  1. Click "Debug" from the menu bar
  2. Click "Attach to Process"
  3. Check the "Show processes from all users" checkbox in the bottom left corner
  4. Select aspnet_wp.exe, w3p.exe, or w3wp.exe from the process list
  5. Click "Attach"

Solution 2 - C#

Just to clarify Jimmie R. Houts answer…

If you want to debug the web application VS and IIS you can do the following:

  1. Host the site inside IIS (virtual directory etc).

  2. Then in VS2005 do this:

    • Right Click on Web Project → Properties → Start options → Use Custom Server → Base URL → Enter Site Address as Hosted in IIS.
    • Hit F5 and you will be able to Debug your code

Same works for VS 2008 also.

Solution 3 - C#

I'm running Windows 7 with IIS Version 7.5 and I also needed to tick the "Show processes from all users" and "Show processes in all sessions" boxes - at the bottom of the "Attach to Process" dialog.

Also I had put my app in a specific App Pool which means you can then see it labeled against the w3wp.exe.

Solution 4 - C#

The IIS process is aspnet_wp.exe.

In fact, attaching to the aspnet_wp.exe process is what VS does when you have your project set to use IIS for debugging.

Solution 5 - C#

The possible names of the ASP.NET process:

  • w3wp.exe is IIS 6.0 and later.
  • aspnet_wp.exe is earlier versions of IIS.
  • iisexpress.exe is IISExpress.
  • dotnet.exe is ASP.NET Core.
  • inetinfo.exe is older ASP applications running in-process.

From Find the name of the ASP.NET process

Solution 6 - C#

You'll also need to open Internet Information Service From Control Panel > Administrative Tools. Right click the web site in question, click the home directory tab, and select the configuration button. This will open a new form with three tabs - click the debugging one and select the two options in the debugging flag section. This is also necessary to debug.

Solution 7 - C#

Using an Attach to IIS plugin (VS2015, VS2017) plugin saves a few clicks - especially when dealing with an ecosystem of IIS hosted sites (one frontend with multiple backend services say)

Solution 8 - C#

If you see the process [e.g. IIS Worker Process (w3wp.exe)] running is Task Manager, but not in the list of processes in debug > attach to process, you might need to run Visual Studio as administrator.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMihai LazarView Question on Stackoverflow
Solution 1 - C#Al WView Answer on Stackoverflow
Solution 2 - C#AmitdView Answer on Stackoverflow
Solution 3 - C#The CoderView Answer on Stackoverflow
Solution 4 - C#Jimmie R. HoutsView Answer on Stackoverflow
Solution 5 - C#Michael FreidgeimView Answer on Stackoverflow
Solution 6 - C#MikeView Answer on Stackoverflow
Solution 7 - C#fiatView Answer on Stackoverflow
Solution 8 - C#HauklandView Answer on Stackoverflow