Solved

"found conflicts between different versions of the same dependent assembly" problem

Posted on 2010-11-26
5
2,076 Views
Last Modified: 2012-05-10
I have a .NET 3.5 solution with one project, building an assembly.

When I build I get the warning:

"found conflicts between different versions of the same dependent assembly"

Running with verbose revealed the following:

    There was a conflict between "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
        "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
    C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.

The only way I could get a fix for this was to set the reference to "specific version=true".

Double clicking on the error and accepting the offer to update app.config checks the file out of TFS but doesn't change it and doesn't resolve the problem.

Is there a way to fix this that doesn't require specific version to be set to true?

0
Comment
Question by:purplesoup
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:buraksarica
ID: 34217383
Are you using Asp.net ajax library for 2.0? if you migrated your app from 2.0 to 3.5, there is no need to reference the v1.0 of the assembly because .net 3.5 already comes with ajax support.
0
 

Author Comment

by:purplesoup
ID: 34217625
Yes I'm using Ajax, and I can set the version to 3.5, but if I set specific version to false it seem to automatically switch back to 1.0.

I'm guessing perhaps that there is an assembly I am referencing that references 1.0 and that is causing the problem, but it isn't that easy to find out which assembly this is (or there may be more than one).

My point is, is there a way I set specific version to false and not get this message?
0
 
LVL 5

Accepted Solution

by:
buraksarica earned 500 total points
ID: 34217883
yes it's hard to identify, so you can use a tool. Read here : http://ianfnelson.com/blog/msb3247/
0
 

Author Comment

by:purplesoup
ID: 34218586
OK I have installed nDepend and run the query against the code:

SELECT ASSEMBLIES WHERE
DepthOfIsUsing "System.Web.Extensions" >= 0
ORDER BY DepthOfIsUsing

(this apparently means list all the assemblies that are using this assembly directly or indirectly)

The only assembly it says is using System.Web.Extension is my main project.

Looking further at the list of assemblies, I can see there are two versions listed in the references list. One comes from my project reference paths folder, the other from the .NET Framework, by removing my project reference path I find I can reference the 3.5 version without having specific version=true.

Thanks.
0
 

Author Closing Comment

by:purplesoup
ID: 34218590
Thanks for your help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question