Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Setting property Enable32BitAppOnWin64 for IIS 7 in C#

Setting property Enable32BitAppOnWin64 for IIS 7 in C#

Scheduled Pinned Locked Moved C#
csharpwindows-admin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mushtaque Nizamani
    wrote on last edited by
    #1

    ServerManager mgr = new ServerManager();
    mgr.ApplicationPools["test"].Enable32BitAppOnWin64 = true;
    mgr.CommitChanges();

    Above code should set property Enable32BitAppOnWin64 to true for application pool having name test, but it doesn't do that, can anyone please tell what am I doing wrong. Please note that ServerManager class is present in Microsoft.Web.Administration namespace.

    Thanks, Mushq

    P 1 Reply Last reply
    0
    • M Mushtaque Nizamani

      ServerManager mgr = new ServerManager();
      mgr.ApplicationPools["test"].Enable32BitAppOnWin64 = true;
      mgr.CommitChanges();

      Above code should set property Enable32BitAppOnWin64 to true for application pool having name test, but it doesn't do that, can anyone please tell what am I doing wrong. Please note that ServerManager class is present in Microsoft.Web.Administration namespace.

      Thanks, Mushq

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Do you get any exceptions? I use the following code and it works fine for me (cutdown a bit):

      using (ServerManager mgr = new ServerManager())
      {
      ApplicationPool appPool = mgr.ApplicationPools[appPoolName];
      if (appPool == null)
      throw new ApplicationException(string.Format("The pool {0} does not exist", appPoolName));
      appPool.Enable32BitAppOnWin64 = true;
      mgr.CommitChanges();
      }

      Deja View - the feeling that you've seen this post before.

      My blog | My articles | MoXAML PowerToys

      M 2 Replies Last reply
      0
      • P Pete OHanlon

        Do you get any exceptions? I use the following code and it works fine for me (cutdown a bit):

        using (ServerManager mgr = new ServerManager())
        {
        ApplicationPool appPool = mgr.ApplicationPools[appPoolName];
        if (appPool == null)
        throw new ApplicationException(string.Format("The pool {0} does not exist", appPoolName));
        appPool.Enable32BitAppOnWin64 = true;
        mgr.CommitChanges();
        }

        Deja View - the feeling that you've seen this post before.

        My blog | My articles | MoXAML PowerToys

        M Offline
        M Offline
        Mushtaque Nizamani
        wrote on last edited by
        #3

        Hi Pete, Thanks for the response and sorry for the late reply.

        Pete O'Hanlon wrote:

        Do you get any exceptions?

        No, I don't get any exception. I have observed when i try to set property through code it shows me that the property has been successfully changed to true even next time I try to get that property programmatically it shows me that property is true, but when I open that in IIS it shows me that property to be false. Please check the screen shot for that. http://img87.imageshack.us/my.php?image=iiswin32bitcheckmf6.jpg[^]

        Kind Regards, Mushq

        1 Reply Last reply
        0
        • P Pete OHanlon

          Do you get any exceptions? I use the following code and it works fine for me (cutdown a bit):

          using (ServerManager mgr = new ServerManager())
          {
          ApplicationPool appPool = mgr.ApplicationPools[appPoolName];
          if (appPool == null)
          throw new ApplicationException(string.Format("The pool {0} does not exist", appPoolName));
          appPool.Enable32BitAppOnWin64 = true;
          mgr.CommitChanges();
          }

          Deja View - the feeling that you've seen this post before.

          My blog | My articles | MoXAML PowerToys

          M Offline
          M Offline
          Mushtaque Nizamani
          wrote on last edited by
          #4

          Hi Pete O'Hanlon, I was checking that property incorrectly, you are right that your mentioned code is working fine. Thanks a lot.

          Kind Regards, Mushq

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups