Is it possible to start IIS Express from the command line using the /path argument and include an HTTPS binding?
Another common way to start IIS Express is to issue the command iisexpress /path:c:myapp /port:80This command runs the site from the c:myappfolder over port 80.
I want that IIS runs permanently, so without command line. Open a command prompt. For example, you can start your IIS Express named site by issuing the command iisexpress /site:WebSite1 where WebSite1 is a site from the user profile configuration file (C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config)
Run the following command to navigate to the IIS Express installation folder: cd Program FilesIIS Express or if you are using a 64-bit OS, run the following command: cd Program Files (x86)IIS Express Run the following command to view the IIS Express usage string: iisexpress /?
You can also use the /path option to run a site directly from a folder. This option works for any type of application, including static HTML, ASP.NET, PHP, and WCF. By default, IIS Express will run the site on http://localhost:8080/. For a managed website, such as ASP.NET, IIS Express will use .NET 4.0.
Another one for the scripts section:
IisExpressAdminCmd setupSslUrl -url:https://localhost:44308 -UseSelfSigned
appcmd add site /name:"MySite" /bindings:https/*:44308:localhost /physicalPath:"C:\MySite"
iisexpress /site:MySite
Those commands are in the C:\Program Files (x86)\IIS Express\
directory.
Following link would help you in configuring https port (especially read "Making an SSL Cert, hooking it up to IIS Express and making it Trusted" from this link ) https://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
When /path command line option is used, IIS Express uses the template appliationhost.config file located in %programfiles%\IIS Express\AppServer (on 64-bit machine %programfiles(x86)%\IIS Express\AppServer). Edit 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With