Can I automate creating a .NET web application in IIS?

I can suggest you to take a look at this link if you are deploying on IIS 6 or at this one if it is IIS 7 (I could recommend Mike Volodarsky's blog for any information on IIS 7 in general).

It should be quite simple for you to write some batch file to automate a site creation.

Example:

  • IIS6 : iisweb /create C:\Rome "My Vacations" /d www.reskit.com /dontstart
  • IIS7 : %windir%\system32\inetsrv\AppCmd ADD SITE /name:MyNewSite /bindings:http/*:81: /physicalPath:c:\inetpub\mynewsite

You're really asking two different questions. First, why reinvent the wheel? In all likelihood, the laptops are already capable of running IIS - it's available on all "modern" Windows versions with the possible exception of Vista Home. Second, a VS.NET installer can easily target and automate an install to IIS. If you use Wix or some other third party installer it will require more manual work but can still be done.

Edit: In re-reading your question, that sounds like what you're really asking - you already knew IIS was available on the target computers, but just didn't want to manually install on each computer. Correct? In that case, definitely look at the VS.NET setup project - they have a built-in target for IIS deployment.


To implement a minimal web server you can use HTTP.SYS (the core component of IIS deployed with Windows XP SP2 or higher). In .NET this can be done e.g. by using the HttpListener class in the System.Net namespace.