6

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.

enter image description here

2 Answers 2

8

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();
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.