Using DotPeek, it shows the version referenced by our assembly is System.Web.Mvc 2.0.0.0 - building the same project on many other machines correctly shows System.Web.Mvc 4.0.0.0. So it's getting it wrong during compilation.
UseSpecificVersion true didn't make a difference.
The only way around this has been to add a binding redirect as:
It seems that one of the third-party DLLs our project was referencing was causing this to happen. Not sure why some machines experience it and others don't though but the redirect is necessary.
Marked as answer by LittleClive on May 15, 2012 08:31 AM
LittleClive
Member
91 Points
65 Posts
Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0
May 14, 2012 10:38 AM|LINK
On some developer machines we're getting the following:
Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
Using DotPeek, it shows the version referenced by our assembly is System.Web.Mvc 2.0.0.0 - building the same project on many other machines correctly shows System.Web.Mvc 4.0.0.0. So it's getting it wrong during compilation.
UseSpecificVersion true didn't make a difference.
The only way around this has been to add a binding redirect as:
<dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> </dependentAssembly>But this seems like a bit of a hack to use a runtime binding fix since the DLLs seem to be built differently during compilation.
Any thoughts appreciated.
LittleClive
Member
91 Points
65 Posts
Re: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0
May 14, 2012 02:30 PM|LINK
It seems that one of the third-party DLLs our project was referencing was causing this to happen. Not sure why some machines experience it and others don't though but the redirect is necessary.