Launch IIS Express using / path from the command line using HTTPS?

Is it possible to start IIS Express from the command line using the / path argument and enable HTTPS binding?

+4
source share
3 answers
  • The following link will help you configure the https port (especially read "Creating an SSL certificate, connecting it to IIS Express and its reliable" from this link) http://blogs.iis.net/shanselman/archive/2011/04/21/ working-with-ssl-at-development-time-is-easier-with-iisexpress.aspx

  • If the / path command line option is used, IIS Express uses the template appliationhost.config file located in% programfiles% \ IIS Express \ AppServer (on 64-bit machines% programfiles (x86)% \ IIS Express \ AppServer). Change the binding element in this configuration file as shown below (change the protocol to "https")

    <binding protocol="https" bindingInformation=":8080:localhost" /> 
  • Now from the IIS Express installation folder, run iisexpress.exe /path:"<path-to-your-web-application>" /port:<HTTPS-port-configured-in-step-1>

+3
source

I also struggle with this. Its not exactly the pristine solution you want, but you can add a new site to your default iisexpress configuration via the command line:

 APPCMD add site /name:MyNewSite /bindings:"http/*:81:" /physicalPath:"C:\MyNewSite" 

Do you want to target appcmd.exe in c: \ program files (x86) \ iis express

After adding it, you can start iisexpress in the usual way, using iisexpress.exe, focusing on the site that you just added to the configuration.

Manipulating objects using ADD, SET, and DELETE

You need to "enable" iisexpress for ssl service.

Working with SSL at design time is easier with IISExpress

However, it might just be easier / cleaner to write your own configuration file with the bindings you want and load the site using this. More control this way.

+1
source

Another section for scripts:

 IisExpressAdminCmd setupSslUrl -url:https://localhost:44308 -UseSelfSigned appcmd add site /name:"MySite" /bindings:https/*:44308:localhost /physicalPath:"C:\MySite" iisexpress /site:MySite 

These commands are located in the C:\Program Files (x86)\IIS Express\ directory.

+1
source

All Articles