Lazycoder

12Sep/080

Debugging Managed Web Applications on x64

I ran into an interesting problem a while back. I needed to fire up the debugger and figure out what was going on in a web application. I tried my usual keystroke, F5, to start debugging the web application but received an exception telling me that the debugger could not start.

CannotStartDebugger

No big deal, I’ll just attach to the web server process. Ah, but there’s a catch. I’m running Windows XP 64-bit. My web application is written in managed .NET code but it’s running on IIS which is native x64 code. So when I look at my process list, I see that T-SQL, Managed, and Native code is running in that process.

AttachToProcess

If I let the “Attach to process” dialog pick the correct debugger for me, it appears to try and debug the native x64 code running in that process. Since I’m trying to debug my managed application, I guess the debugger can’t switch between managed code and native code.(1).

So the key here is to make sure I select “Managed code” from the debugger dialog.

SelectDebugger

This ensures that I’m using the correct debugger and my breakpoints are getting hit.

Now, I’m back to having to figure out what the application is doing.

(1) – I’m sure there is a better technical explanation for what is happening here. If anyone can explain it better, please leave a comment with the explanation or a link to a blog/forum/arcticle.

Share and Enjoy:
  • del.icio.us
  • DotNetKicks
  • DZone
  • Reddit
  • Digg
  • StumbleUpon
  • LinkedIn
  • Facebook
  • FriendFeed
  • HackerNews
  • Netvibes
  • Posterous
  • Tumblr
  • Twitter
Filed under: .NET Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.