3

When we configure a web application to run in IIS Express there are certain things VS does, like:

  1. Creating the application host configuration file in the IISExpress subfolder of the user documents folder.
  2. Creating a dedicated site section for each web application in the solution, including ours.

Maybe more things are done, which I am unaware of.

I would like to replicate the same process from a script, so that running the web application from the script would be equivalent to running it from VS. Including for the very first time.

Right now I start IISExpress with the /port and /path flags, because this is how I used to run Cassini. However, Cassini supported an additional flag - /vpath. They removed it from IISExpress, meaning I have to use another set of flags - /config, /site, /siteid. But I suspect it must be done in conjunction with the Appcmd.exe utility.

This second approach is still something I haven't managed to master. So, my question is this - suppose I am given the port, path and vpath of a web application (i.e. no need to read them from the web application's csproj file, like VS does). What command sets up the right application host configuration file and how do I run IISExpress to take advantage of it?

mark
  • 59,016
  • 79
  • 296
  • 580

0 Answers0