C# – “The source file is different….” message in Visual Studio 2008 is result of debugging x32 apps on x64 Windows

cdebuggingvisual studiovisual-studio-2008

I'm writing ADO.NET provider. For debugging I use class DbProviderFactories.GetFactory method. This method constructs my inherited DbProviderFactory class that i use for create DbConnection inheritor of my provider and etc.. When I try set breakpoint in my provider code I sow it isn't work – execution doesn't stopped. When I throw exception in my code VS2008 showed message box describing "The source file is different…".
Debugging works good before day before tomorrow, but it isn't now. Does somebody know "magic checkbox" for resolve my trouble? Any idea?

Update1: Provider assembly is adding to GAC on post build step. Compiler didn't find errors in solution.
Update2: Source code of static referenced assemblies is "different" too.

Update3 and last: I've found source of trouble. I use x64 version of Windows 7. My application use some COM servers (usual native x32 COM Servers) that can't be loaded in x64 context. So I decided run it as x32 app using WOW so I set platform target as x32. But debugger started show messages like "The source file is different….". I don't understand why it works as works. I will write to microsoft support team.

Best Answer

You can tell it to ignore the problem by going to Tools, Options, going to the Debugger section, and unchecking Require source files to exactly match the original version.

To solve the problem, check your assembly locations. Your program is probably referencing a different version of your provider DLL than the one in the debugger. Try removing the reference and adding a Project Reference.

EDIT: Try removing the provider from the GAC (manually or at the beginning of the post-build step)