程序集'System.Web.Http.Cors,5.2.3.0使用'System.Web.Http,5.2.3.0',该版本具有比引用的程序集'System.Web.Http,5.1.0.0更高的版本 [英] Assembly 'System.Web.Http.Cors, 5.2.3.0 uses 'System.Web.Http, 5.2.3.0' which has higher version than referenced assembly 'System.Web.Http, 5.1.0.0

查看:427
本文介绍了程序集'System.Web.Http.Cors,5.2.3.0使用'System.Web.Http,5.2.3.0',该版本具有比引用的程序集'System.Web.Http,5.1.0.0更高的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将FluentValidation.WebApi(通过程序包管理器控制台命令"Install-Package FluentValidation.WebAPI")安装到我的C#项目中时,出现以下错误:

When i am installing FluentValidation.WebApi (through package manager console command "Install-Package FluentValidation.WebAPI") to my c# project, i get following error:

程序集'System.Web.Http.Cors,Version = 5.2.3.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'使用'System.Web.Http,Version = 5.2.3.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'具有比引用程序集'System.Web.Http,Version = 5.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'更高的版本d:\ Code \ companyname \ libs \ System.Web.Http.Cors.dll companyname.Service

Assembly 'System.Web.Http.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' d:\Code\companyname\libs\System.Web.Http.Cors.dll companyname.Service

我应该怎么做才能摆脱这种情况?我有生产项目,并且我不想更新任何可能影响任何其他控制器或模块的内容.所以我想要一些完全安全的解决方案?

What should i do to get rid of this? I have production project and i don't want to update anything that might impact any other controller or module. So i want some completely safe solution?

我注意到一件非常有趣的事情.在安装FluentValidation.WebApi之前,我项目的引用具有System.Web.Http版本5.2.3.0.但是,一旦我安装了此软件包(FluentValidation.WebApi),System.Web.Http版本就会更改为5.1.0.0.

I noted very interesting thing. Before installing FluentValidation.WebApi, my project's references had System.Web.Http version 5.2.3.0. But once i install this package (FluentValidation.WebApi), the System.Web.Http version changes to 5.1.0.0.

推荐答案

您安装的程序包向MVC 5.2.3.0 dll引入了依赖性.我采用的方法是在安装任何其他软件包之前先更新MVC项目:

The package you installed introduced dependencies to MVC 5.2.3.0 dll's. The path I take is to update the MVC project prior to any other package installs:

Install-Package Microsoft.AspNet.Mvc -Version 5.2.3

https://www.nuget.org/packages/microsoft.aspnet.mvc

这篇关于程序集'System.Web.Http.Cors,5.2.3.0使用'System.Web.Http,5.2.3.0',该版本具有比引用的程序集'System.Web.Http,5.1.0.0更高的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆