0

When trying to assign a Managed RunTime Version version with this code:

using (ServerManager serverManager = new ServerManager())
    {
       ApplicationPool newAppPool = serverManager.ApplicationPools.Add("HICS");
       newAppPool.ManagedRuntimeVersion = "No Managed Code";
    }

It sets the version to "No Managed Code", but it's not the right selection. I end up with this: enter image description here

If I select the other "No Managed Code", the App Pool works just fine. Why is it creating a duplicate option? How can I select the existing "No Managed Code"? Using C# code of course..

1 Answers1

0

Try setting it to "", like in this answer. It should still work, although they are setting this value in a slightly different method.

using (ServerManager serverManager = new ServerManager())
{
   ApplicationPool newAppPool = serverManager.ApplicationPools.Add("HICS");
   newAppPool.ManagedRuntimeVersion = "";
}
Broots Waymb
  • 4,713
  • 3
  • 28
  • 51