I have a ASP.net Web API, that I am trying to host on IIS 10 (Windows 10 Pro). If I access this Web API form Angular 2 app, I get the following error
XMLHttpRequest cannot load http://172.26.50.17:8085/api/library. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 500.
But, If I host the same Web API on the IIS 7 (Windows 7), I do not get the above error. Could someone please help me understand this problem. Why do I need to do on IIS 10 to get rid of this error.