From 9364062300ec882ce4142b0f5765306d4550260c Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Thu, 30 Jul 2020 09:56:11 +0300 Subject: [PATCH] [Windows] .NET Framework Performance Issue (#1316) * ngen KB2570538 * suppress ngen log output --- images/win/Windows2019-Azure.json | 6 ++++++ images/win/scripts/Installers/Run-NGen.ps1 | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 images/win/scripts/Installers/Run-NGen.ps1 diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 431d1af29..f7f414f3f 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -771,6 +771,12 @@ "{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Run-NGen.ps1" + ] + }, { "type": "powershell", "inline": [ diff --git a/images/win/scripts/Installers/Run-NGen.ps1 b/images/win/scripts/Installers/Run-NGen.ps1 new file mode 100644 index 000000000..c00aa1a4a --- /dev/null +++ b/images/win/scripts/Installers/Run-NGen.ps1 @@ -0,0 +1,6 @@ +Write-Host "NGen: Microsoft.PowerShell.Utility.Activities" +$null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "Microsoft.PowerShell.Utility.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" +Write-Host "NGen: Framework64" +$null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe update +Write-Host "NGen: Framework" +$null = & $env:SystemRoot\Microsoft.NET\Framework\v4.0.30319\ngen.exe update \ No newline at end of file