views:

42

answers:

1

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!

A: 

The only times I've ever seen this are when a project has been set to build in Release mode rather than Debug mode.

How easy it is to check this will depend on your IDE setup, it may already be there in your toolbar, but if it's not.

  1. Right click on the solution
  2. Select Configuration Manager...
  3. Ensure that Debug is selected in the "Active solution configuration" drop down
knightpfhor
Nope, checked already -- I only have a Debug configuration in the project I'm currently working on. And, again, there's no 'compile' step to invoke the configuration -- it's just save the .ASP file, and refresh the browser. Thanks, tho!
Val
Does this problem occur on anyone else's machine? If it does, check the build settings for the project to make sure it's producing the right debug info. I presume you've tried rebuilds? If none of this works then I'd probably just throw my hands in the air, scream, and then reinstall VS.
knightpfhor
There's nothing to build, but I did a Rebuild anyway, to no effect. I'll see if I can reproduce on another machine, tho -- good idea! I don't think it's just VS -- it happens in all versions of VS, plus the MS Script Debugger, so some common component is being invoked...
Val