What is the difference between AspNet.Cors and AspNet.WebApi.Cors?

In my application, I have the following two nuget packages installed:

  • Microsoft.AspNet.Cors - 5.2.2
  • Microsoft.AspNet.WebApi.Cors - 5.2.2

My application is a WebAPI web interface connected to an AngularJS interface. Internal and external interfaces are located on different web servers. The application uses bearer authentication and the login is established using a call / token. I am using ASP.Net Identity 2.1

I managed to get CORS to work in the following ways from here:

http://www.codeproject.com/Articles/742532/Using-Web-API-Individual-User-Account-plus-CORS-En

However, I would like to learn more about the differences between the two Cors packages. Are they both required for my type of project and when will you use AspNet.Cors and when will you use WebApi.Cors?

+6
source share
1 answer
  1. Microsoft.AspNet.WebApi.Cors: Use it to enable the CORS request ONLY for the web API .

  2. Microsoft.AspNet.Cors: I think you can use this when you want to enable CORS for your MVC controllers .

  3. Microsoft.Owin.Cors: , CORS , , , , , Web API SignalR CORS - Microsoft.Owin.Cors.

, .

+10

All Articles