TiraULTI TiraULTI - 4 months ago 43
C# Question

Enable 32 bit IIS Application Pool c#

I am making an application that creates several application pools and webs on IIS.

I need to enable 32 bit applications in one of them.

How can I do it programatically?


You did not specify IIS version. For old ones, one could use DirectoryServices as described here: https://msdn.microsoft.com/en-us/library/ms525598%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396

The property for 32 bit should be "Enable32BitAppOnWin64" if I rememeber correctly.

For IIS 7+, you should use Microsoft.Web.Administration namespace as described here: https://www.iis.net/learn/manage/scripting/how-to-use-microsoftwebadministration

This is a managed api. Check the reference posted or experiment a little.

Also, if you have IIS Metabase Compatibility installed with IIS 7, the first solution should work too. (Not available on newer systems)