I'm having trouble debugging any ASP Classic website on my workstation using any of the MS debugging environments available to me. I'm on Win XP SP3, using the builtin IIS 5.1.
It started a few weeks ago, and happens across multiple projects. Something clearly changed in my environment, because it was working fine in the past, even in recent IDEs as long as I Attach to process. Then it broke as described below. I'd given up on it, but I started working on a new project recently, tried to debug and it worked! Today, though, it's back to the same broken behavior:
When I try to set a breakpoint, the IDE actually sets the point a few lines above or below the line I clicked. I'm trying to set the breakpoint on lines that are entirely server-side code, so it's not because it's skipping before or after HTML with embedded code nuggets. Occasionally it won't set the breakpoint, giving me a hollow breakpoint icon and presenting an error that says there's no executable code on the line.
When I attach to the IIS process (inetinfo.dll, as I'm running in low isolation mode), the breakpoint may not be hit. If it is, and I start single-stepping, the selected line jumps around, and doesn't land on every continuous line in the source, nor follow control structures as expected. Watched variables are not updated as expected. It's clearly seeing different code than I do for the same line numbers.
The same behavior happens whether I load the page in a browser and
- Attach to the process from VS2010, set a breakpoint and refresh the page, or
- set the breakpoint, attach to the process, and refresh, or
- add a 'stop' statement in my source, and refresh the page. In that case, I'm presented a list of available debuggers, and every one of them does exactly the same thing -- they skip the SAME lines of code and follow the SAME 'incorrect' paths. I've tried VS2010, 2008, 2005, 2003, and the Microsoft Script Debugger.
It seems that the source code is out of sync with what the debugger is stepping through. I've made certain that 'Require source files to exactly match the original version' is set in VS > Tools >Options > Debugging > General
And, of course, these are ASP Classic sites -- there's no compiled code, so the source I see in the IDE should be the same as what the debugger's executing. It's not specific to one project -- it's happening on at least two completely separate projects at the moment. And, it's happening on multiple machines -- I deployed my project to a test server and tried to debug there, and got the same behavior.
I found some information on similar-sounding problems related to UTF-encoded files containing non-ANSI characters (you know, the ones you use Unicode to support!) here, here and here, but I went thru my source and can't find any files like that.
Any ideas? Thanks!