1

I have an application referencing the wrong version of Microsoft.Practices.Unity; it is referencing version 3.5.1.0 instead of version 3.0.0 in visual studio, and the project file there is the correct version. However, during runtime I get an exception about version of Unity not found.

I have tried to clean the solution and rebuild, and created an app.config file to override bindings

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

but the wrong version of the dll is still searched for.

user3071284
  • 6,955
  • 6
  • 43
  • 57
Shachaf.Gortler
  • 5,655
  • 14
  • 43
  • 71
  • You may want to check the reference for it's "specific version" flag. Here's a good SO article on that. http://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i – MutantNinjaCodeMonkey Nov 18 '15 at 18:18
  • See http://stackoverflow.com/questions/32705371/could-not-load-file-or-assembly-entityframework-version-6-0-0-0/32705433#32705433 – Alex Krupka Nov 18 '15 at 19:01
  • Specific version flag is not used , and I doPeek to have a look at the dll referencing the wrong version , and in doPeek it is referencing the correct version – Shachaf.Gortler Nov 18 '15 at 19:03
  • 1
    Tried to just remove the dll from references, rebuild, and then add the dll to the reference list again by right clicking "references" add references and then clean and rebuild again? Usually fix up messed version references in VS. – Ørjan Nov 19 '15 at 10:02
  • That did the trick, thanks – Shachaf.Gortler Nov 20 '15 at 20:47

0 Answers0