Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Microsoft.AspNet.WebApi.Cors version issue in WebAPI

I have installed Microsoft.AspNet.WebApi.Cors package using Install-Package Microsoft.AspNet.WebApi.Cors in my WebApi project(.net framework 4.5.2) and now I'm getting below error while compiling the project.

Reference: http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api

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.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

like image 734
Jitendra Pancholi Avatar asked Mar 13 '15 12:03

Jitendra Pancholi


Video Answer


1 Answers

You need to install following nuget package for this.

Install-Package Microsoft.AspNet.WebApi.Cors.ko -Version 5.0.0

This will work.

like image 132
Pankaj Sharma Avatar answered Oct 16 '22 11:10

Pankaj Sharma