Tip: Found conflicts between different versions of the same dependent assembly

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
I recently had an issue with this compiler warning that just wouldnt go away. I followed the advice given here:

http://www.xenopz.com/blog/bartdeboeck/PermaLink,guid,5bc4efba-e2df-46b7-808e-9678c47a1367.aspx

(which is a great page btw)
but I couldnt get my dependency graph to show two versions of the dll that the IDE was complaining about - all my graphs showed just the one version.

Eventually I traced the problem to one of my DLLs (for reporting problems to the helpdesk) that was dependent on another DLL. Both the problem reporting DLL and my main app require access to the preferences table stored in the database. I'd updated the preferences DLL and removed a constructor that problem reporting was using. I'd made the necessary code changes in the main app, but it turned out I'd forgotten to update the code of the problem reporting DLL.

What slowed the investigation down was that the problem reporting component carried on building OK, yet the solution explorer on the reference to the prefs DLL said that the DLL in use was the latest version.

To date, i'm not sure why the old code carried on building fine, referring to a constructor that didnt exist in the new version. It doesnt even follow that a cached old version of th dll existed because I searched the entire hard disk and removed all old versions.

Just a heads up, if you run into a similar situation:

You can find out which assembly is conflicting by looking in the output window when building. Messages appear about suggesting an app.config mapping to remove the warning and they mention the assembly and the two versions suspected.
Remove and re-add the reference to the suspected problematic assembly, in all assemblies that depend on it.
Rebuild those solutions, and any breaking changes you made to the dependent assembly should show up as compiler errors


Hopefully, the scenario described in that blog, would work for you and show you two boxes with different versions of the same assembly
 

Latest posts

Back
Top