IIS Express + Visual Studio 2010 + non-local project url
I ran into a dilemma related to a different question , but not quite the same.
I want to use IIS Express with a custom url, but without modifying the local HOSTS file.
Specifically, for me
, 127.0.0.1 is resolved using DNS (our DNS is configured in such a way that
127.0.0.1 is resolved). This is what I want to use as the project url. If I add
HOSTS to my file it works, but if I don't, it doesn't. I am guessing this is because Visual Studio does not recognize this as a local url.
Is there a way to not modify the HOSTS file, but use a custom url, for example
, as a project url in Visual Studio using IIS Express?
source to share
Yes-sortof. The configuration is
saved in the profile of the executable users in the section:
You will need to edit applicationhost.xml
Find the section
<site name="WebApplication1" id="20"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\inetpub\WebApplication1" /> </application> <bindings> <binding protocol="http" bindingInformation="*:45965:localhost" /> <binding protocol="http" bindingInformation="*:80:dev.example.com" /> </bindings> </site>
Please note that port 80 should not be occupied by IIS in case it is running in your dev block.
The problem this solution is having is that with these settings, when pressing F5 in VS or otherwise launching a website from VS, you ALWAYS want to start from localhost and not initialize another binding. You have to start IISExpress manually with the following:
c: \ Program Files (x86) \ IIS Express \ iisexpress.exe "/ site:
source to share