13

Im trying to build an installer for my asp.net core service, but im having problems setting the .NET CLR Version on IIS app pool. Is there any way to set it to No Managed Code?

Setting <iis:WebAppPool ManagedRuntimeVersion="No Managed Code"> results in error The worker process failed to pre-load .Net Runtime version No Managed Code.

Milan Halada
  • 1,943
  • 18
  • 28

3 Answers3

24

Solution is to use "" instead of "No Managed Code" when setting managedRuntimeVersion.

David Aleu
  • 3,922
  • 3
  • 27
  • 48
PhilAI
  • 532
  • 4
  • 7
  • You cannot select "" in IIS GUI – Exegesis Jun 03 '22 at 18:45
  • this is correct but remember property name is case sensitive: **managedRuntimeVersion** ```Set-ItemProperty -Path IIS:\AppPools\your_apppool_name -Name managedRuntimeVersion -Value ""``` – David Aleu Jul 18 '22 at 19:19
1

Use the below sample method to create Application pool with No Managed Code

public void CreateApplicationPoolDotNetCore(string appPoolName)
{
    using (ServerManager serverManager = new ServerManager())
    {
         ApplicationPool newPool = serverManager.ApplicationPools.Add(appPoolName);
         newPool.ManagedRuntimeVersion = "";
         newPool.Enable32BitAppOnWin64 = true;
         newPool.ManagedPipelineMode = ManagedPipelineMode.Integrated;
         serverManager.CommitChanges();
     }
}
Sunil Ram
  • 21
  • 2
0

The iis:WebAppPool/@ManagedRuntimeVersion attribute's value cannot be an empty string.