Visual Studio 2015. Failed to register URL for site access is denied IIS Express. Access denied 0x80070005

asp.net-mvc-5iis-expresslocalhostsslvisual-studio-2015

I enabled SSL in Visual Studio 2015 in order to implement Facebook and Google login locally.

I changed the project URL in the Web tab of the project's properties to https://localhost:44300/ and decorated the controller with the RequireHttps attribute – ref @msdn.

Everything worked fine locally.

I reverted settings to HTTP to test something else and that caused me a problem when I tried to get back to HTTPS.

I found this SO question and tried almost every suggested solution.

Error detail:

Failed to register URL "url" for site "site" application "path".
Error description: Access is denied. (0x80070005).

Best Answer

I had to issue this command in DOS to solve the problem in VS 2015:

netsh http add urlacl url=http://{ip_addr}:{port}/ user=everyone

Strangely this was only needed when I moved the project to a different PC. On the original PC I didn't need it.