IIS CLI generate applicationhost.config with site for my project

Viewed 1616

I have a C# solution with several projects, one of which is a web server run by IIS. I have set <UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile> in the csproj file of that project.

When I open Visual Studio, it generates this in ~/Documents/IISExpress/config/applicationhost.config:

    <sites>
        <site name="WebSite1" id="1" serverAutoStart="true">
            <application path="/">
                <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation=":8080:localhost" />
            </bindings>
        </site>
        <site name="SealingService" id="2">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\Users\sehch\Documents\Paragon\ParagonCore\servers\SealingService\SealingService" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:61800:localhost" />
                <binding protocol="https" bindingInformation="*:44300: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>

I want to be able to run my project with IIS Express from the command line (for build server integration testing purposes). How can I generate the SealingService site section of applicationhost.config from the command line (without opening Visual Studio)?

I have tried running

"C:\Program Files (x86)\IIS Express\iisexpress.exe"

in my solution folder, but it only generates the WebSite1 section.

1 Answers
Related