Sunday, September 23, 2018
Sign-In  |  Sign-Up  |  Contact Us  | Bookmark |  RSS Feed

Developing for IIS with Microsoft.Web.Administration  
Developing for IIS is new option available with the arrival of IIS API library called: Microsoft.Web.Administration. You need to make sure reference is included into your Web project before proceeding with the code. We provide you with the code snippets that you may use in your development for IIS. Code sample is written in VB.NET but you should be able to understand it in C# as well . Let say we are tasked for creation of the new site programmatically.

First step is to declare ServerManager object in your code behind. This allows us to access properties and method required for the next step.

Dim SM As New ServerManager
Dim bindingInfo As String
Dim mySite As Site

Second, we need to create an App Pool for this site which is done via call to ApplicationPools.Add method of the ServerManager.


Third, we proceed with the creation of the site itself with the help of another Method of ServerManager call Sites.Add

mySite = SM.Sites.Add(SiteNameTextBox.Text, "HTTP", bindingInfo, PathTextBox.Text)

Finally, we need to associate Application Pool that we created in step two with our website. This is done in the following way.

mySite.Applications(0).ApplicationPoolName = NameTextBox.Text

All work is done and we need to make sure it is committed into our object model via call to CommitChanges method. SM.CommitChanges()

Print Developing for IIS with Microsoft.Web.Administration Bookmark Developing for IIS with Microsoft.Web.Administration

Related Articles  
Windows Cache Extension for PHP - IIS Extension
Windows Cache Extension for PHP is an IIS extension design to accelerate PHP applications which are paltformed on ...
IIS Application Development Features
IIS application development features provide support for dynamic content being run on the IIS. Content includes ...
Supported Application Frameworks on IIS
IIS 7.0 and 7.5 are designed to support legacy application so that transition is ease, allowing to deploy websites ...
FastCGI for IIS
IIS Fast CGI grants common application structures which are platformed under FastCGI protocol the functionality to be ...
IIS Smooth Streaming Player Development Kit (SSPDK)
Recently, Microsoft has just announced the release of the IIS Smooth Streaming Player Development Kit (SSPDK) 1.0. It ...
Web Playlists - IIS Extension
IIS Media Server Web Playlists extension grants hosters and developer’s unparalleled manipulation over media contents ...