When we configure a web application to run in IIS Express there are certain things VS does, like:
- Creating the application host configuration file in the IISExpress subfolder of the user documents folder.
- 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 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?
P.S.
I have asked the same question on SO - http://stackoverflow.com/questions/30251062/how-to-setup-iis-express-from-a-script-the-way-visual-studio-does-it