Assembly 'System.Web.Http.Cors, 5.2.3.0 uses &

2019-09-11 05:06发布

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

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?

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.

1条回答
迷人小祖宗
2楼-- · 2019-09-11 05:48

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

查看更多
登录 后发表回答