I have a application that I would like to deploy programmatically with C# to IIS with default settings. Basically I would like to do what is in the screen shot below on a button click. Any help or guidance on this would be great.
2 Answers
This solved it for me. I was missing the
using Microsoft.Web.Administration;
ServerManager web = new ServerManager();
web.Sites["Default Web Site"].Applications.Add("/Web", Drive + "/Portal/Web");
web.Sites["Default Web Site"].Applications.Add("/WebAPI", Drive + "/Portal/WebAPI");
web.CommitChanges();
Comments
Use the power of powershell
Here is a good article about it: http://www.iis.net/learn/manage/powershell/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools
