views:

256

answers:

1

This is driving me crazy. I have a rather large project that I am trying to modify. I noticed earlier that when I typed DbCommand, visual studio did not do any syntax highlighting on it, and I am using using System.Data.Common. Even though nothing was highlighted, the project seemed to be running fine in my browser. So I decided to run the debugger to see if things were really working as they should be. Every time the class that didn't do the highlighting is called I get the "the source file is different from when the module was built" message. I cleaned the solution and rebuilt it several times, deleted tmp files, followed all the directions here http://stackoverflow.com/questions/353421/getting-the-source-file-is-different-from-when-the-module-was-built, restarted the web server and still it tells me the source files are different when they clearly are not. I cannot test any of the code I have written today because of this. How can the source be different than the binary when I just complied it? Is there any way to knock some sense into visual studio, or am I just missing something?

+1  A: 

Some things for you to check:

Have you double checked your project references?

Do you have a Visual Studio started web server still running? Check the system tray and look for a page with a cog icon (you may have more than one):

alt text

Right click and close/exit it. You may have more than one. Can you debug your changes now?

Are you running the debug version but have only built the release version (or vice versa)?

Did the compile actually succeed? I know I've clicked through the "there were errors, do you want to continue anyway?" message a couple of times without realising.

ChrisF
The compiles do succeed. I am a bit of a noob when it comes to Visual Studio. How do I check to see if I am running the debug version or the release?
frustratedcoder
@frustrated - I was just trying to eliminate the obvious. To check whether you're in release or debug check the drop down next to the "debug" icon on the toolbar. It will be either "Debug" or "Release".
ChrisF
Thank you. It does say debug. Is that what it should be?
frustratedcoder
@frustrated - It's a good start ;). You can "debug" release code, but it's not as useful - but that's not relevant here. It does mean you are (or at least should be) building and running the debug binaries. I'll have to think some more - without actually seeing the problem it's a bit difficult to diagnose.
ChrisF
"without actually seeing the problem it's a bit difficult to diagnose"I figured as much. I do appreciate the help though
frustratedcoder
@frustrated - check my update, I've thought of something else.
ChrisF