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 dev.example.com

, is resolved using DNS (our DNS is configured in such a way that *.example.com is resolved). This is what I want to use as the project url. If I add dev.example.com

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 dev.example.com

, as a project url in Visual Studio using IIS Express?


source to share

1 answer

Yes-sortof. The configuration is IISExpress

saved in the profile of the executable users in the section:



You will need to edit applicationhost.xml

Find the section <sites>

and continue:

        <site name="WebApplication1" id="20">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\inetpub\WebApplication1" />
                <binding protocol="http" bindingInformation="*:45965:localhost" />                  
                <binding protocol="http" bindingInformation="*:80:dev.example.com" />


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: WebApplication1



All Articles