PDA

View Full Version : Visual Studio 2005 - Debug code with compile errors?



Swerve
03-17-2008, 06:20 AM
Hi,

Some code I'm trying to create won't build and so am receiving a "unable to build, run last successful build?" message.

Is it possible to step through code with the debugger whilst an error(s) still exists at all?

Many thanks!

matsp
03-17-2008, 06:51 AM
Yes and no.

Yes, you can step through the previously compiled code.

No, you it won't make ANY sense to do so. If you have made anything but the most trivial changes, the line-numbers won't match up, so likely is that you won't get ANYTHING useful out of such an exercise.

Compiler errors prevent the compiler from producing the final output because the compiler errors mean that there's something "missing" (or misplaced, etc), and the compiler just can't produce something useful.

Consider something sending you a message (e-mail for example) to say "Let's meet around 6pm at". The place to meet at is obviously missing. So do you then follow the message and go wait at a random place at 6pm, or do you ask the sender to specify WHERE?

Same with the compiler: if it doesn't get the message, it will not GUESS what you wanted to have happen. It tells you what is "missing", then asks you to rectify the situation.

--
Mats

Swerve
03-17-2008, 08:12 AM
Thank you matsp

:)

Appreciated.