What is better for administering IIS in ASP.Net: WMI or ADSI or a managed API? and what's the difference?

I am working on setting up and managing and managing IIS 6.0 and later using an ASP.Net-based web application. I consider WMI, ADSI, Managed API as my options.

I have a target Windows System WIN2k3 or later. The choice of language is C #, and the application must be built using ASP.Net.

This article describes each of the methods, but I'm a little unsure of the various things; http://learn.iis.net/page.aspx/283/provisioning-options-in-iis7/rev/1

I have the following questions regarding these options.

  • Which is better or more powerful for the stated purpose? ADSI (System.DirectoryServices) or WMI (Microsoft.Web.Management) or managed API (Microsoft.Web.Administratoion)? Correct me if I do something wrong.

  • Which option or technology is likely to be supported for later versions of IIS?

  • Which option has maximum flexibility and scalability?
  • Where can I find resources for any of the proposed / selected technologies?

I am less likely to work on II5.1 or lower. Thus, the compatibility zone starts with IIS 6.0 and higher. The application must be built using ASP.Net, and unmanaged code can be used if this is unavoidable.

thanks

Hi

Steve

+4
source share
2 answers

For IIS6, I would use the System.DirectoryServices namespace, which is a managed wrapper around ADSI. I find this easier to use than working with WMI IIS providers.

For IIS7 and Sealed Offers, I would use the new IIS 7 Managed Code Administration API ( Microsoft.Web.Administration et al). You can use IIS6 compatibility components on IIS7 that support the old-style ADSI APIs for consumers (but are a wrapper around the new IIS7 components), and they basically work.

However, you have encountered problems with ADSI wrappers. For example, they don’t know about the Mapping Handler (similar to the properties of IIS6 Script Map), for example preConditions , which, for example, allow several versions of ASP.NET handler display definitions to be shared in the same site or application. The ADSI compatibility level will create objects known as AboMapperCustom objects that are not optimal in configuration and are not aware of these new features.

Having two codebases (one for IIS6 and one for IIS7) may seem like a lot of work, but to be honest, it's not so bad. I work for a hoster, was on this road, and we removed the bullet and decided that we would keep the old IIS6 code, but we would restart using IIS7.

+4
source

For IIS 7 and above, you probably want the IIS Management API . I assume that you have already read the MSDN administration technology comparison . Given only 1 project, I would use the tool with which you are most familiar. Everything related to the direct processing of the IIS metabase requires special study.

Given the learning curve, I choose to use WMI. It is widely used outside of IIS and is mastered as a good investment. C # supports it well. If you know a little PowerShell, you can easily learn it with the gwmi object. If you use WMI from .NET, start with a managed generator code .

+4
source

Source: https://habr.com/ru/post/1300700/


All Articles