Logo
  Wednesday, July 18, 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.

SM.ApplicationPools.Add(AppNameTextBox.Text)

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  
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 ...
IIS Smooth Streaming Format SDK 1.0
IIS Smooth Streaming Format SDK 1.0 Beta 2 supplies samples, tools and documentations specific for usage in the ...
Bit Rate Throttling in IIS 7.0 and 7.5
Another IIS Media Services extension is Bit Rate Throttling – procedurally meters the network cost values by measuring ...
IIS Application Development Features
IIS application development features provide support for dynamic content being run on the IIS. Content includes ...
Smooth Streaming IIS Extension
IIS Media Services Smooth Streaming extension grants the ability to process variable media streaming targeting ...
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 ...
More