views:

596

answers:

3

I use the x64 version of Windows 7. My application use some COM servers (usual native x86 COM Servers) that can't be loaded in x64 context. So I decided run it as a x86 application using WOW so I set platform target as x86.

But Visual Studio debugger started to show messages like "The source file is different...." for all source files when I try debug it. What is reason for this behaviour? This question was born there http://stackoverflow.com/questions/2013943/the-source-file-is-different-message-in-visual-studio-2008-is-result-of-deb

Update: I cleaned solution, rebuilt solution, removed obj, bin and etc. folders, restarted computer, reinstalled Visual Studio... So, what else could be the problem?

Update2: If you create new Windows Application project and change target platform to x86 you will see this trouble. But if you delete Settings1.settings from project the trouble will be eliminated!!. Any Idea?

Update3: http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/bc297668-65b4-46e8-969e-c7a6340d33b6

+3  A: 

The error message you are getting is unrelated to debugging a WOW64 bit application. It's even less of an issue here because Visual Studio runs a 32 bit process inside of WOW64. So instead of x64 -> x86 you are actually doing an x86 -> x86 debugging session.

What's going on here is that Visual Studio is reading the checksum for the source files out of the PDB and it does not match the checksum of the files you are using to debug the application. The most likely causes for this are

  • Out of date PDB's
  • Using the incorrect source files. This is more common than you think in branching scenarios where you could easily grab the wrong version of the file.

The way I typically debug through this is

  • Close VS and manually delete all of the binaries and binary directories
  • Restart VS and rebuild
  • Close VS
  • Restart VS and attach to the running project without opening the solution
  • Then manually open the files
JaredPar
See my Update 2
Dmitry Borovsky
+1  A: 

You might also check the x86 build type. When you created it you may not of copied the settings from the default build and as such none of your code is building when you run your application.

Bring up the Solution Properties and check the Configuration Properties\Configuration page. Then make sure all of the projects are checked under Build for the Config/Platform combo you are using.

Matthew Whited
Indeed, projects being excluded from build in the current configuration seems a common mistake to me. However, a total clean of the solution (as the OP did) should make you notice that?
0xA3
True. But he is ignoring the compiler errors/build messages he may not have seen this probable. Also if he was to tell it to explicitly build after a clean he also would not see this problem.
Matthew Whited
I haven't made x86 "build type", I have just changed Platform target on Build page of project properties from Any CPU to x64. It's all.
Dmitry Borovsky
See my Update 2.
Dmitry Borovsky
+1  A: 

Windows 7 sets Windows Xp sp 3 compatibility mode for VS 2008 by default. Changing compatibility to Windows Vista SP2 mode have solved trouble.

Dmitry Borovsky
For me this worked for Visual Studio 2010 as well.
Andreas H.R. Nilsson