Recreating site in IIS from configuration file

Recreating site in IIS from configuration file

am 17.08.2007 02:52:46 von Bhaskar

Hi,
I am trying to programmatically (using ASP.NET C#) create a new site in IIS
from a "configuration file" (XML format) that was created in IIS. To
elaborate, I have saved a "configuration file" of a web site manually (i.e.
right click a web site in IIS -> All Tasks -> Save Configuration to a
File...). Next, the site gets deleted by the process (i.e. the web
application that I am developing) which can be done without a problem. But
NOW I need to use this same tool (once again, using C#) to recreate the site
in IIS using the configuration file that was saved (i.e. equivalent to right
click at the root level in IIS -> New -> Web Site from file...and the point
to the XML file that was created manually). I have tried to look for "Invoke"
method's "methodName" under DirectoryEntry namespace, MSDN, Google without
any luck. Anybody has any idea?
If you can give me some direction that will be greatly appreciated.
Thank you in advance,

--
Bhaskar Roy

Re: Recreating site in IIS from configuration file

am 20.08.2007 08:54:31 von Egbert Nierop

"Bhaskar" wrote in message
news:10978D23-C2E8-4204-8364-591AF0715685@microsoft.com...
> Hi,
> I am trying to programmatically (using ASP.NET C#) create a new site in
> IIS
> from a "configuration file" (XML format) that was created in IIS. To
> elaborate, I have saved a "configuration file" of a web site manually
> (i.e.
> right click a web site in IIS -> All Tasks -> Save Configuration to a
> File...). Next, the site gets deleted by the process (i.e. the web
> application that I am developing) which can be done without a problem. But
> NOW I need to use this same tool (once again, using C#) to recreate the
> site
> in IIS using the configuration file that was saved (i.e. equivalent to
> right
> click at the root level in IIS -> New -> Web Site from file...and the
> point
> to the XML file that was created manually). I have tried to look for
> "Invoke"
> method's "methodName" under DirectoryEntry namespace, MSDN, Google without
> any luck. Anybody has any idea?
> If you can give me some direction that will be greatly appreciated.
> Thank you in advance,

The IIS MMC does this coding itself.
So you should code the XML save as and read from your selves. (There is no
WMI/ADSI property that does this for you)

--
Classic & Mixed Session management for ASP
http://www.nieropwebconsult.nl/asp_session_manager.htm

Re: Recreating site in IIS from configuration file

am 20.08.2007 18:26:03 von Bhaskar

Hi Egbert,
I am not sure if I understood your response very well.
Would you kindly elaborate?
Thank you in advance,
Bhaskar Roy
--
Bhaskar Roy


"Egbert Nierop (MVP for IIS)" wrote:

>
> "Bhaskar" wrote in message
> news:10978D23-C2E8-4204-8364-591AF0715685@microsoft.com...
> > Hi,
> > I am trying to programmatically (using ASP.NET C#) create a new site in
> > IIS
> > from a "configuration file" (XML format) that was created in IIS. To
> > elaborate, I have saved a "configuration file" of a web site manually
> > (i.e.
> > right click a web site in IIS -> All Tasks -> Save Configuration to a
> > File...). Next, the site gets deleted by the process (i.e. the web
> > application that I am developing) which can be done without a problem. But
> > NOW I need to use this same tool (once again, using C#) to recreate the
> > site
> > in IIS using the configuration file that was saved (i.e. equivalent to
> > right
> > click at the root level in IIS -> New -> Web Site from file...and the
> > point
> > to the XML file that was created manually). I have tried to look for
> > "Invoke"
> > method's "methodName" under DirectoryEntry namespace, MSDN, Google without
> > any luck. Anybody has any idea?
> > If you can give me some direction that will be greatly appreciated.
> > Thank you in advance,
>
> The IIS MMC does this coding itself.
> So you should code the XML save as and read from your selves. (There is no
> WMI/ADSI property that does this for you)
>
> --
> Classic & Mixed Session management for ASP
> http://www.nieropwebconsult.nl/asp_session_manager.htm
>
>