15

I have IIS express loaded and running from a command line entry. I am using the default applicationhost.config file (I know it's the correct file as I have changed the 1st site's port a couple of times etc).

The strange thing is, I have two sites defined, and it appears only the first one gets loaded? I am sure IIS express can load multiple sites right? as long as different ports?

Here is the <sites> definition bit from the applicationhost.config file:

<sites>
    <site name="BF Local SVN" id="1">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="C:\_CODE SOURCECONTROL\BizzfaceLocalSVN" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:6464:localhost" />
        </bindings>
    </site>
    <site name="SquirrelITfreeformBS" id="2">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="C:\_CODE SOURCECONTROL\SquirrelITfreeformBS" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:6465:localhost" />
        </bindings>
    </site>
    <siteDefaults>
        <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
        <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
    </siteDefaults>
    <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
    <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>

As you can see, two sites defined, different site ID's and different ports?

Any ideas?

2
  • Can you please provide the command line you're using to launch IIS Express?
    – Joshua
    Aug 22, 2011 at 3:38
  • Hi Joshua, sorry for the delay.. I was literally running "iisexpress" at the command line.. from what I understood, it would load the default applicationhost.config and process. Actually the answer below as fixed it.. I didn't realise you could do that. Thanks again.
    – Dav.id
    Aug 23, 2011 at 4:11

1 Answer 1

49

When you run iisexpress.exe from command line (without any command line arguments), it starts the first site given in default applicationhost.config file (%userprofile%\documents\iisexpress\config\applicationhost.config).

To start multiple sites, use /apppool switch as shown below;

iisexpress.exe /apppool:Clr4IntegratedAppPool

Above command would start all the applications that are using 'Clr4IntegratedAppPool' app pool.

3
  • 1
    Cool, thank you! had no idea you could do that - so saved me heaps of time! thanks!
    – Dav.id
    Aug 23, 2011 at 4:12
  • You can also create a shortcut and set it to run "minimized" if you want to hide the command window. See howtogeek.com/howto/windows-vista/… for an example.
    – Greg Bray
    Aug 7, 2013 at 17:47
  • Great tip here. Couldn't find it anywhere else. Now, I just need to find out how to keep Visual Studio from stuffing all of my projects into the same apppool name. Right now, they're all in Clr4IntegratedAppPool. I need a separate apppool for each solution so that I can start multiple servers for each with a single command. Anyone know how to do that?
    – Artif3x
    May 13, 2015 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.