简体   繁体   中英

Assembly 'XXX' which has a higher version than referenced assembly

At the moment I code in an old solution for a customer. At first I want to migrate the system to VS2017.
I solved all problems but one:

Error CS1705 Assembly 'Crm.Library' with identity 'Crm.Library, Version=3.2.16.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc' with identity 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' Crm.Web C:\\Source\\src\\Crm.Web\\CrmApplication.cs 158 Active

So I tried a lot of things like adding this to web.config :

<dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.2.3.0" />
</dependentAssembly>    

Also tried to set the specific version in the config to 'false'

配置画面

The problem is still the same..

Anyone got an idea?

Your Crm.Library assembly, which I'm assuming is probably a class library in your solution, is referencing MVC5, while the project(s) you're including it in are referencing MVC4. You can't mix and match like that. Either Crm.Library needs to reference MVC4 like the rest of the projects, or you need to upgrade them all to MVC5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM