ASP.NET WebApi (Visual Studio 2013) - CORS Installation Error RRS feed

  • Question

  • User135423268 posted

    Good Day Everyone

    I'm having trouble when installing CORS on my ASP.NET WEBAPI Solution

    First I install the CORS using the Package Manager Console by typing this

    Install-Package Microsoft.AspNet.WebApi.Cors

    After I install this, I try to to test run my site and I receive the error below

    Could not load file or assembly 'System.Web.Http, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    after that I found the solution here:


    which the solution is 

    "Update-Package Microsoft.AspNet.WebApi -reinstall."

    Now after this I'm not having a problem when running my web application, but my problem right now is 


    EnablCors does not found in HttpConfiguration

    The Solution for this is to install again the CORS using this again "Install-Package Microsoft.AspNet.WebApi.Cors"

    But I got another error when I try to run my application which is:

    A direct route cannot use the parameter 'controller'

    and I point on the line below


    I don't know what to do, What I want is to use the cors for my Web API but an error is always showing.

    Please help me to solve this.

    Thursday, August 16, 2018 8:57 AM


All replies