I want to change Local path in the Home Directory tab of the Default Website in IIS, programmatically from the C# code.
-
what are you trying to do ? i dont think you are in the right wayRoyi Namir– Royi Namir2011-10-20 08:29:22 +00:00Commented Oct 20, 2011 at 8:29
-
I want to change the localpath that exists in the home directory tab of the iisHanuj Reddy– Hanuj Reddy2011-10-20 08:30:54 +00:00Commented 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 ).Royi Namir– Royi Namir2011-10-20 08:32:20 +00:00Commented 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 programaticallyHanuj Reddy– Hanuj Reddy2011-10-20 08:34:16 +00:00Commented 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.aspxGary.S– Gary.S2011-10-20 08:40:20 +00:00Commented Oct 20, 2011 at 8:40
|
Show 2 more comments
2 Answers
Have a look at some articles and posts :
- Programmatically Manage IIS - CodeProject
- How to Programmatically Modify the IIS Virtual Directory - MSDN blog
- Creating a new website programmatically on IIS using ASP.NET and C#
- IIS 6.0 programmatically - Problem creating virtual directories AND not setting it as a Application
- Configuring IIS using Directory Services and C#
Comments
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#