1

I want to change Local path in the Home Directory tab of the Default Website in IIS, programmatically from the C# code.

7
  • what are you trying to do ? i dont think you are in the right way Commented Oct 20, 2011 at 8:29
  • I want to change the localpath that exists in the home directory tab of the iis Commented Oct 20, 2011 at 8:30
  • yeah I understood that , but what is you e scenarios which you need to deal with ? cause I really dont think you should do so( if possible ). Commented Oct 20, 2011 at 8:32
  • Actually I am doin a project which configures entire application in which I need to configure iis also and thats y i need to do it programatically Commented Oct 20, 2011 at 8:34
  • any reason you can't use something like MSDeploy? it will configure IIS, app pools, locations, vdirs, etc... MSDeploy walkthrough - msdn.microsoft.com/en-us/library/dd465322.aspx. Walkthrough using generated .cmd file - msdn.microsoft.com/en-us/library/ff356104.aspx Commented Oct 20, 2011 at 8:40

2 Answers 2

1

Have a look at some articles and posts :

  1. Programmatically Manage IIS - CodeProject
  2. How to Programmatically Modify the IIS Virtual Directory - MSDN blog
  3. Creating a new website programmatically on IIS using ASP.NET and C#
  4. IIS 6.0 programmatically - Problem creating virtual directories AND not setting it as a Application
  5. Configuring IIS using Directory Services and C#
Sign up to request clarification or add additional context in comments.

Comments

0

There are managed APIs to deal with IIS, see John's asnwer here: IIS API - Create virtual directories? for an example and also here: Creating a new website programmatically on IIS using ASP.NET and C# the body of the method: CreateWebsite.

both are examples and should be adapted but a good starting point to show you how to interact with IIS from .NET / C#

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.