views:

315

answers:

3

Hi, 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.

A: 

Try doing a clean (Build-> Clean Solution), and then rebuilding All (Rebuild Solution).

Mitch Wheat
))it was second that I did. First was rebuild solution.
Dmitry Borovsky
A: 

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)

SLaks
1. My assembly isn't static referenced, I wrote that I use DbProviderFactories.GetFactory for create instances.2. I think that uncheck "Require source files to exactly match the original version" isn't good way to solve trouble, it's only hide it.PS: I like Sara Ford too))
Dmitry Borovsky
1:It looks like `DbProviderFactories.GetFactory` is using an older version of the assembly. Try removing it from the GAC. 2: That's why I said that it will _ignore_ the problem instead of solving it.
SLaks
Unfortunately, It didn't help. But I observed that even source code of static referenced assembly is "different".
Dmitry Borovsky
Look at the Modules window (Debug, Modules) and see where it's loading the assembly from. Then, check the date modified of the file, and try deleting it.
SLaks
Assembly is loaded from GAC (c:\Windows\assembly\GAC_MSIL\MyAssemblyName\1.0.11.0__78db361f61f0be66). Time of creation is 3 minutes ago (added on post build step). PDB was loaded from my debug folder.Ok. I deleted all my assemblies from GAC again, I cleaned debug folder and deleted all obj folders. Rebuiding and.... “The source file is different…” as ussual.
Dmitry Borovsky
Are you running a debug or release build?
SLaks
I'm running debug build
Dmitry Borovsky
File containing Main method is "different" too. But when I create new solution containing console application project and set break point i wasn't "different", all was OK.
Dmitry Borovsky
Something strange is going on. Try rebooting.
SLaks
I tried, it didn't help. I tried reinstall VS and it didn't help too.
Dmitry Borovsky
I've found source of trouble. I post it as "Update 3" in my question description.
Dmitry Borovsky
A: 

“The source file is different…” message in Visual Studio 2008 is result of debugging x32 apps on x64 Windows. See new thread

Dmitry Borovsky