Running IIS Express with admin privileges

Morvael picture Morvael · Nov 19, 2012 · Viewed 33.9k times · Source

This has been asked before but was closed as "Not a real question"

https://stackoverflow.com/questions/7450813/how-to-run-a-site-with-administrative-privileges-in-iis-express-7-5

However I think it is a genuine question as I also need to do this, there are MS documents explaining how to "Run IIS Express without Administrative Privileges" but as this is how it runs by default the need for this article quite frankly baffles me. However I have no idea on how to run it with Admin privileges.

When I try to start my VS2012 website I get the following error message from IIS express: "Cannot start the website because administrative privileges are required to bind to the hostname or port", and links are provided to the MS documents about running it without admin privileges.

What I'm ultimately trying to do is run my dev sites locally as http ://vs2012:nnnnn, this is so I can attach fiddler debugger (due to the bypass of proxies in IE when localhost is used)

This used to work fine, this morning I did a reinstall of windows and have now hit a brick wall!

Does anyone know how to give IIS express admin privileges as indicated in the error message?

Answer

Charitha Goonewardena picture Charitha Goonewardena · Jul 18, 2016

For Visual Studio 2015 and 2012 this solution will work.

  1. Go to Solution Explorer in Visual Studio, right click the web project and select "Unload Project"
  2. Next on the same project, right click and select ‘Edit Project File‘
  3. Find the
    <DevelopmentServerPort>0</DevelopmentServerPort><IISUrl>http://localhost:56058/</IISUrl>
    xml tags and and remove them.
  4. Reload the project and run.

Images to follow:

enter image description here