Category Archives: Miscellaneous

Anything that on my mind will be a general topic

Enable CORS IIS Express

While debugging a .NET MVC WebAPI project, I was getting the error, related to cross origin resource sharing:

No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:XXXXX’ is therefore not allowed access.

Once I added the following custom header to the IIS Express application host configuration, the errors disappeared.

I also read updating the C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config file can fix the problem, but this didn’t work for me.

Final result:

<httpProtocol>