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?
IIS Express was designed to allow the most common web development and testing tasks to be performed without administrative privileges.
To run IIS Manager with administrative privileges on the server machine, instead of logging on as an administrator, it is recommended you use the runas command in the non-administrative user context, for example: runas /user:<AdministratorAccount> “%SystemRoot%\system32\inetsrv\inetmgr.exe”. ...
IIS Express runs as your user account. When installed, you should find an IISExpress folder in your My Documents folder.
For Visual Studio 2015 and 2012 this solution will work.
<DevelopmentServerPort>0</DevelopmentServerPort><IISUrl>http://localhost:56058/</IISUrl>
Images to follow:
I've worked it out.
I switched Visual Studio to running with Administrative Privileges and also found the .exe for IIS Express and set that to always run with administrative privileges. I'm not 100% sure the second was needed but did them both anyway.
I hope this helps some one else who's had this same issue.
EDIT
(19/08/2013)
This only seemed to work in Windows 7, On Windows 8 I eventually just gave up and now use the full blow IIS for all my dev work.
EDIT
(07/06/2018)
@Tarostar (Comment below), got this working on Windows 10 VS2017 and a number of others have got it to work on Windows 8 prior to that using the same method. So possible I was doing something wrong on my Windows 8 box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With