Search code examples
portiis-expressadministrationhostnameelevated-privileges

Running IIS Express with admin privileges


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?


Solution

  • 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.