0

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.

Sahil Sharma
  • 3,847
  • 6
  • 48
  • 98
  • 1
    Possible duplicate of [.NET Binding Redirection for Compilation](http://stackoverflow.com/questions/21885889/net-binding-redirection-for-compilation) – David Levin Aug 08 '16 at 09:33
  • As pointed out in the question from @EvgenyLevin you need to add a binding redirect in your web.config to ensure dependencies target the same referenced assembly version. – Phil Cooper Aug 12 '16 at 08:02

1 Answers1

0

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

Trevor Reid
  • 3,310
  • 4
  • 27
  • 46
Douglas Wiley
  • 483
  • 1
  • 7
  • 10