views:

486

answers:

5

So, this interesting issue has been plaguing me for the past couple of hours. Visual Studio 2010 Ultimate no longer attaches the debugger and lets me debug my code.

If I use the built in development server, then everything works fine. If I switch to Use Local IIS Web Server (http://localhost/), then all it does it attach to w3wp.exe, but no DLLs or PDBs are loaded for anything. I can go to Debug > Windows > Modules, and literally nothing is loaded in this window. Conversely, when using the built in development server, the Modules window displays all the DLLs and shows that the symbols for my DLLs have been loaded. Something is obviously amiss. The VS installation is completely bone stock.

In IIS, my website is configured with ASP.NET 2.0 (because no 3.5 exists to select from the drop down), along with read / log visits / index this resource options checked on the "Home Directory" tab.

Some of my failed ideas:
1) If I attach to process on the iexplore.exe instance where the website is displayed, it loads Internet Explorer's DLLs, but not mine.
2) I've restarted the computer multiple times
3) I've invoked devenv.exe /resetuserdata once
4) I've confirmed that every project is indeed set to debug and not release.
5) Deleted all \bin contents and rebuilt the solution.
6) Deleted entire solution and repulled from Source Control.

Can someone tell me what is wrong with this thing? I'm going to have an aneurism from the headache this is causing me.

A: 

Have you tried deleting the browser cache? Sometimes the browser hangs on to old code which is incompatible with the current build and thereby prevents debugging.

Nick Gotch
I've cleared IE's cache, as well as Chromes. Neither browser works when I use Local IIS Web Server. Both work when I set it to Built in Server.
Tejs
A: 

I've had an issue before where under the build configuration screen some projects are unticked for a particular solution configuration, causing them to not build and therefore not be debuggable. Can you confirm whether or not code changes you make are actually being built and executed?

Also, what version of Windows and IIS are you running? Is it possible that your process is running under an AppPool with an account that's different to the account you're logged in with and perhaps it's a permissions problem? If it's Vista/Win7, is UAC turned on and are you running VS as administrator? I'll also second the suggestion to try a fresh project and see what that does. Are you in the debugger users local group on the machine?

Terence Lewis
All of the projects are currently set to build in Configuration Manager. 7) In addition, I've unreferenced and then re-added the references to the projects that are dependencies.
Tejs
A: 

Does it run the app - without the debugger attached? It smells like you are attaching the debugger to a wrong process

mfeingold
It does run the app completely. I'm at a loss on what process it might be attaching to though - and if it was attached to some other process, why do none of that process' DLLs shows in the Module window?
Tejs
+2  A: 

You need to attach it to the IIS worker process, which OS are you using? Make sure you attach with the Managed + Native flags, in the Attach to Process. What happens if you just run (F5) your web application inside Visual Studio (that automatically attaches a debugger)? Do you get any errors?

Ion Todirel
It looks like you're on to something. I made a minor modification and it wasn't reflected. The debugger is attempting to attach to w3wp.exe, as shown here: http://img710.imageshack.us/img710/4606/outputwindow.png
Tejs
Do you have any breakpoints set? If yes when Visual Studio is attached, if you go to a breakpoint what does it says? There usually is a message if a breakpoint cannot be hit
Ion Todirel
You know, just to make sure that everything works I'd suggest to start with a brand-new/fresh (well as Visual Studio creates it) web application. Once you make sure that works (debugging) with IIS, we can continue excluding other possibilities. It's possible that you are not attaching to the process correctly, that would happen if the code is loaded by CLR 4.0, but you are attached with the CLR 2.0 flag which ends up with the debugger having different expectations.
Ion Todirel
Ok, Day 2! @Ion - yes, it says Breakpoint will not be hit because no symbols have been loaded. The Modules Window shows no DLLs or PDBs loaded.
Tejs
@Ion - Working on creating a test project right now...
Tejs
The test project builds and runs fine when used with Local IIS Web Server. So it must be something with my project.
Tejs
Well, everything seems to be magically working right now...
Tejs
Glad to hear that.
Ion Todirel
A: 

Try disabling the 'Just My Code' debug option.

500 - Internal Server Error