The project currently contains references to more than one version

24,399

Solution 1

I was able to fix this issue by removing all of the files in my bin folder and then rebuilding the project. For me the issue was that cleaning the project was only deleting DLLs in the bin\Debug folder while old DLLs were remaining in the bin\Release folder.

Solution 2

First the workaround: I disabled the Assembly version Autoincrement!

Notes that this problem occured only in Vs2013 with a copy of a solution running perfectly vs2010. Vs2013 Build, rebuild, clean solution, manual deletion of ./bin or ./obj or %TEMP% did not solve the problem. I also composed a new solution from scratch in Vs2013 to avoid corpses from vs2010: this new solution compiled only twice: the third time the error appeared again without any way... something in the machine stayed dirty.

Now the explication...

I had same problem on a solution with 86 project with the following outline: the '60.dll' is the wrong dll:

- 99.exe 
-- 80.dll
---- 70.dll
------- 60.dll
-- 81.dll
-- 82.dll
---- 60.dll

So the BC32206 error occurred with the reason.

The project '99.exe' currently contains references to more than one version of '60.dll, 
a direct reference to version 4.11.5618.23545 and an indirect reference (through '82.dll') to version 4.11.5618.23549. 
Change the direct reference to use version 4.11.5618.23549 (or higher) of '60.dll'

Note that the version differ only in revision from 23545 to 23549 (so only '4' unit): in some rebuild this difference was '1' unit; remebering that this number is the (seconds since midnight/2), I realized that for some reason the '60.dll' was compiled twice ... Nothing to do: i did not find any different copy of '60.dll' with the datetime corresponding to higher value request '23549'. So it is real that something is bugged in Vs2013.

So the last chance: I disabled Autoincrement and I pinned the Assembly version to X.Y.0.0: this is quite enough for my purpose because '60.dll' is a part of a comprehensive release and should never be deployed stand alone (I still use the fileVersion to browse the correct file)

Share:
24,399
user1955468
Author by

user1955468

Updated on July 09, 2022

Comments

  • user1955468
    user1955468 almost 2 years

    We recently upgraded to VS2012 and .NET 4.5. Since switching to 2012, I constantly get these errors when debugging:

    Compiler Error Message: BC32206: The project currently contains references to more than one version of NPGUtilities, a direct reference to version 2012.4.4751.24389 and an indirect reference (through 'AdminWeb.targetweights.sgModels') to version 2012.4.4751.24391. Change the direct reference to use version 2012.4.4751.24391 (or higher) of NPGUtilities.

    BC32206: The project currently contains references to more than one version of EnterpriseData, a direct reference to version 2012.4.4751.25227 and an indirect reference (through 'SponsorWeb.selectplan.AdministratorXDataset1') to version 2012.4.4751.25243. Change the direct reference to use version 2012.4.4751.25243 (or higher) of EnterpriseData.

    Both of those are project references. I have tried removing and readding them but still no luck. Can anyone offer any advice on how to resolve this issue?

  • user1955468
    user1955468 over 11 years
    They all appear to be the same, everywhere that i've looked. I even removed the reference from all three projects in the solution and added it back.
  • Kami
    Kami over 11 years
    Grab a copy of each conflicting dll. Add it to the sub project, clean and build the sub project, and then add the same dll to the main project and compile. Repeat for each dll/subproject. If you use the same file reference from the main and sub projects the versions should match up. Currently, you have a newer version in the cache for you sub projects and it is causing the issue.
  • TheNorthWes
    TheNorthWes over 9 years
    Shouldn't clean do that?
  • bbodenmiller
    bbodenmiller over 9 years
    You'd think but for me it didn't.
  • TheNorthWes
    TheNorthWes over 9 years
    Clean is the biggest mystery since we found fire.
  • Pyves
    Pyves almost 7 years
    Some additional information would probably be beneficial.
  • defines
    defines over 6 years
    Clean only cleans the currently-selected build configuration.
  • Pavlos Papanikolaou
    Pavlos Papanikolaou almost 4 years
    @TheNorthWes Clean indeed did the job.