Where does the solution look for source files?

Where does the solution look for source files?

I typically do my daily development in a folder such as


And then at certain points of the development cycle, I'll copy it to, say,

C:\Data\MyApp\Rev 2.07

But when I go to debug the solution file in:

C:\Data\MyApp\Rev 2.07

And let's say I hit a data breakpoint or a crash, the debugger will open the file C:\Data\MyApp\DailyBuild\Whatever.for instead of C:\Data\MyApp\Rev 2.07\Whatever.for.

Is there any way to prevent the debugger from opening the wrong file?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

When you say you copy "it", is "it" the .sln file, the source, the exe?

I think (subject to correction) when files are compiled and linked the absolute path to the source is stored in the debug information (I'm pretty sure I've seen absolute paths in there).  I suspect if the debugger finds a source file with a matching name at that absolute path, it thinks its search for source job is done.  When it can't find the source file, then other paths might come into play.

If you rename the original DailyBuild directory before starting debugging, what happens?

(If you are not already familiar with them, then there are source code control systems out there that will make your life much easier for revision tracking.  There is a learning curve and requirement for some setup time, but once you are up and running the benefits clearly outweigh the upfront cost, even for small projects, in my opinion.  I use svn and the ankhsvn Visual Studio integration, but there are several options.)

That makes sense.  I copy the .sln, the source files, the executable, basically - everything, from the "DailyBuild" directory into the "Rev 2.07" directory.  The way I've done my debugging of the "Rev 2.07" solutions is to temporarily rename the "DailyBuild" directory to something else, because that's the only way (I know of) to get the "Rev 2.07" .sln file to load the correct source.

I've looked a bit into the source control systems, but it's hard to get people to take the plunge.  Thanks for the suggestion!

Leave a Comment

Please sign in to add a comment. Not a member? Join today