Attach to w3wp.exe from Visual Studio 2005 on Windows Vista

In: IIS

9 Jan 2007

Doesn’t it just drive you crazy when you KNOW something IS there, but it isn’t? Like when you’re in Visual Studio 2005 on Windows Vista and would like to debug your asp.net application by attaching to the w3wp.exe process. You know you are running asp.net 2.0 code, but the dialog box still claimes that there is NO managed code inside w3wp.exe. But it is! Aaargh.

So you try to figure out what could be wrong, which may include the following:

  • Debug mode for compilation in web.config. Checked.
  • A setting in IIS 7.0 Manager that you’re unfamiliar with. Well, I found a setting for server side debugging in the ASP-section, which existed before. Turning it on didn’t seem to help (why would it?).
  • Maybe something with the application pool? There is a mode for “Managed Pipeline Mode”, but setting it to “Classic” didn’t seem to help (as it shouldn’t). Changing the identity of the pool didn’t help either.
  • At some point I think I’ve seen something about your account having to be a member of a “debugging” group in your Windows machine. However, there are no such user groups in my local machine. <edit>It seems that this group is not necessary since Visual Studio 2005</edit>
  • Also, of course, you have to run Visual Studio 2005 as an administrator, but I’ve done that since the beginning (no need to right click if you set the Properties, Compatability, Run as administrator checkbox for the icon).

I did use Process Explorer to ensure that .net was loaded in w3wp.exe, and sure enough it was.

So I found a note on the web about “Windows Authentication” being used when debugging asp.net. Now I’m not sure if this was the single thing that helped since I tried several things, but after installing “Windows Authentication” in IIS 7.0, the “Managed” code shows up in w3wp.exe and I can attach to it from Visual Studio 2005.

The solution:

  • Control Panel
  • Programs
  • Turn Windows features on or off
  • Internet Informaton Services
  • World Wide Web Services
  • Security
  • Check for “Windows Authentication”
  • Rebooted computer (just in case – don’t know if it was needed or even if iisreset.exe would have been necessary)

Please write a comment if you’ve had the same problem, and got it solved the same way I did, or if you did something else/more to get it working.

<edit>Although primarily about pressing F5 to automatically attach to w3wp.exe, this blog post talks about what needs to be done.</edit>

2 Responses to Attach to w3wp.exe from Visual Studio 2005 on Windows Vista

Avatar

PZ

July 12th, 2007 at 13:20

Yeah I got a problem.

The “Windows Authentication” checkbox is not available in my IIS7. I have the following options under security: Basic authentication, IP Security, Request Filtering, URL authentication. So no “Windows authentication”. Where do I then locate it?

Avatar

Idetrorce

December 16th, 2007 at 03:48

very interesting, but I don’t agree with you
Idetrorce

Comment Form

About this site

I'm a freelance web and mobile developer that likes to share whatever experiences I might encounter. It used to be .NET related, and still is to large extent, but I'm also a struggling agnostic trying out interesting technologies from the big three - Microsoft, Google, Apple - and the open source world.

  • Alok Yadav: hello, mike its works for me thanks .. [...]
  • admin: @Ed M: Thank you for your support. You are right about the phrasing. I'm describing what I'm doing i [...]
  • Ed M: Ah, the "code" tag didn't work in my comment as it did in yours. Let's try again, substituting long [...]
  • Ed M: Thanks so much, Mike. Actually, before I came back here I was experimenting on my own, and I figured [...]
  • admin: @Ed M: Sure, I've thought about it and might add a button that generates complete html that can be c [...]