diff --git a/.portal-docs/docker-hub/README.sdk.md b/.portal-docs/docker-hub/README.sdk.md index 3f9d263c..b4126bf1 100644 --- a/.portal-docs/docker-hub/README.sdk.md +++ b/.portal-docs/docker-hub/README.sdk.md @@ -13,7 +13,6 @@ This image contains the .NET Framework SDK which is comprised of the following p 1. .NET Framework Runtime 1. Visual Studio Build Tools -1. Visual Studio Test Agent 1. NuGet CLI 1. .NET Framework Targeting Packs 1. ASP.NET Web Targets diff --git a/.portal-docs/mar/README.sdk.portal.md b/.portal-docs/mar/README.sdk.portal.md index 7289cf04..263de001 100644 --- a/.portal-docs/mar/README.sdk.portal.md +++ b/.portal-docs/mar/README.sdk.portal.md @@ -4,7 +4,6 @@ This image contains the .NET Framework SDK which is comprised of the following p 1. .NET Framework Runtime 1. Visual Studio Build Tools -1. Visual Studio Test Agent 1. NuGet CLI 1. .NET Framework Targeting Packs 1. ASP.NET Web Targets diff --git a/README.sdk.md b/README.sdk.md index 79b56c55..022afc06 100644 --- a/README.sdk.md +++ b/README.sdk.md @@ -15,7 +15,6 @@ This image contains the .NET Framework SDK which is comprised of the following p 1. .NET Framework Runtime 1. Visual Studio Build Tools -1. Visual Studio Test Agent 1. NuGet CLI 1. .NET Framework Targeting Packs 1. ASP.NET Web Targets @@ -65,25 +64,25 @@ Additionally, .NET Framework 4.8 and 4.8.1 can run apps that were built targetin Tag | Dockerfile ---------| --------------- -4.8.1-20251014-windowsservercore-ltsc2025, 4.8.1-windowsservercore-ltsc2025, 4.8.1 | [Dockerfile](src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile) +4.8.1-20251118-windowsservercore-ltsc2025, 4.8.1-windowsservercore-ltsc2025, 4.8.1 | [Dockerfile](src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile) ### Windows Server Core 2022 amd64 Tags Tag | Dockerfile ---------| --------------- -4.8.1-20251014-windowsservercore-ltsc2022, 4.8.1-windowsservercore-ltsc2022, 4.8.1 | [Dockerfile](src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile) +4.8.1-20251118-windowsservercore-ltsc2022, 4.8.1-windowsservercore-ltsc2022, 4.8.1 | [Dockerfile](src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile) ### Windows Server Core 2019 amd64 Tags Tag | Dockerfile ---------| --------------- -4.8-20251014-windowsservercore-ltsc2019, 4.8-windowsservercore-ltsc2019, 4.8, latest | [Dockerfile](src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile) +4.8-20251118-windowsservercore-ltsc2019, 4.8-windowsservercore-ltsc2019, 4.8, latest | [Dockerfile](src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile) ### Windows Server Core 2016 amd64 Tags Tag | Dockerfile ---------| --------------- -4.8-20251014-windowsservercore-ltsc2016, 4.8-windowsservercore-ltsc2016, 4.8, latest | [Dockerfile](src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile) +4.8-20251118-windowsservercore-ltsc2016, 4.8-windowsservercore-ltsc2016, 4.8, latest | [Dockerfile](src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile) *Tags not listed in the table above are not supported. See the [Supported Tags Policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md). diff --git a/eng/dockerfile-templates/sdk/Dockerfile b/eng/dockerfile-templates/sdk/Dockerfile index 9c144f2d..361aa33c 100644 --- a/eng/dockerfile-templates/sdk/Dockerfile +++ b/eng/dockerfile-templates/sdk/Dockerfile @@ -13,7 +13,7 @@ ENV ` }}# NuGet version to install NUGET_VERSION={{VARIABLES[cat("nuget|version")]}} ` # Install location of Roslyn - ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn" + ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\Roslyn" {{if OS_VERSION_NUMBER = "ltsc2019" && PRODUCT_VERSION = "3.5" : RUN ` @@ -41,14 +41,7 @@ RUN mkdir "%ProgramFiles%\NuGet\latest" ` && mklink "%ProgramFiles%\NuGet\latest\nuget.exe" "%ProgramFiles%\NuGet\nuget.exe" # Install VS components -RUN ` - # Install VS Test Agent - curl -fSLo vs_TestAgent.exe {{VARIABLES["vs|testAgentUrl"]}} ` - && start /w vs_TestAgent --quiet --norestart --nocache --wait --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\TestAgent" ` - && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` - && del vs_TestAgent.exe ` - ` - {{InsertTemplate("Dockerfile.install-vs-buildtools", [], " ")}} +RUN {{InsertTemplate("Dockerfile.install-vs-buildtools", [], " ")}} ` # Trigger dotnet first run experience by running arbitrary cmd && "%ProgramFiles%\dotnet\dotnet" help ` @@ -65,14 +58,13 @@ RUN ` # Cleanup && (for /D %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do rmdir /S /Q "%i") ` && (for %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do if not "%~nxi" == "vswhere.exe" del "%~i") ` - && powershell Remove-Item -Force -Recurse "%TEMP%\*" ` - && rmdir /S /Q "%ProgramData%\Package Cache" + && powershell Remove-Item -Force -Recurse "%TEMP%\*" # Set PATH in one layer to keep image size down. RUN powershell setx /M PATH $(${Env:PATH} ` + \";${Env:ProgramFiles}\NuGet\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\Common7\IDE\Extensions\TestPlatform\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v10.0A\bin\NETFX {{sdkVersion}} Tools\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\ClickOnce\SignTool\") diff --git a/eng/dockerfile-templates/sdk/Dockerfile.install-vs-buildtools b/eng/dockerfile-templates/sdk/Dockerfile.install-vs-buildtools index 41594f05..1e10f0f8 100644 --- a/eng/dockerfile-templates/sdk/Dockerfile.install-vs-buildtools +++ b/eng/dockerfile-templates/sdk/Dockerfile.install-vs-buildtools @@ -3,30 +3,42 @@ _ ARGS: usePowerShell: whether to use PowerShell to download and remove files ^ - set sdkVersion to when(PRODUCT_VERSION = "4.8.1", "4.8.1", "4.8") + set sdkVersion to when(PRODUCT_VERSION = "4.8.1", "4.8.1", "4.8") ^ + set is2016 to OS_VERSION_NUMBER = "ltsc2016" ^ -}}# Install VS Build Tools{{ -if ARGS.usePowerShell: -&& powershell -Command ` + _ VS 2026 does not support Windows Server LTSC 2016 + https://learn.microsoft.com/en-us/visualstudio/releases/2026/vs-system-requirements ^ + set vsBuildToolsUrl to + when(is2016, + VARIABLES["vs|ltsc2016|buildToolsUrl"], + VARIABLES["vs|buildToolsUrl"]) ^ + set vsPath to + when(is2016, + "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools", + "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools") + +}}{{ +if ARGS.usePowerShell:powershell -Command ` $ProgressPreference = 'SilentlyContinue'; ` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` Invoke-WebRequest ` -UseBasicParsing ` - -Uri {{VARIABLES["vs|buildToolsUrl"]}} ` + -Uri {{vsBuildToolsUrl}} ` -OutFile vs_BuildTools.exe `^ -else: -&& curl -fSLo vs_BuildTools.exe {{VARIABLES["vs|buildToolsUrl"]}} `}} +else:curl -fSLo vs_BuildTools.exe {{vsBuildToolsUrl}} `}} && start /w vs_BuildTools @^ ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" @^ ` + --installPath "{{vsPath}}" @^ ` --add Microsoft.Component.ClickOnce.MSBuild @^ ` --add Microsoft.Net.Component.{{sdkVersion}}.SDK @^ ` --add Microsoft.NetCore.Component.Runtime.8.0 @^ ` --add Microsoft.NetCore.Component.Runtime.9.0 @^ ` + --add Microsoft.NetCore.Component.Runtime.10.0 @^ ` --add Microsoft.NetCore.Component.SDK @^ ` --add Microsoft.VisualStudio.Component.NuGet.BuildTools @^ ` - --add Microsoft.VisualStudio.Component.WebDeploy @^ ` + --add Microsoft.VisualStudio.Component.WebDeploy @^ `{{if !is2016: + --add Microsoft.VisualStudio.Component.TestTools.BuildTools @^ `}} --add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup @^ ` --add Microsoft.VisualStudio.Workload.MSBuildTools @^ ` --quiet --norestart --nocache --wait ` && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` -&& del vs_BuildTools.exe ` \ No newline at end of file +&& del vs_BuildTools.exe ` diff --git a/eng/dockerfile-templates/sdk/Dockerfile.ltsc2016 b/eng/dockerfile-templates/sdk/Dockerfile.ltsc2016 index 2c092fe6..f14bee95 100644 --- a/eng/dockerfile-templates/sdk/Dockerfile.ltsc2016 +++ b/eng/dockerfile-templates/sdk/Dockerfile.ltsc2016 @@ -59,13 +59,14 @@ RUN ` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` Invoke-WebRequest ` -UseBasicParsing ` - -Uri {{VARIABLES["vs|testAgentUrl"]}} ` + -Uri {{VARIABLES["vs|ltsc2016|testAgentUrl"]}} ` -OutFile vs_TestAgent.exe ` && start /w vs_TestAgent --quiet --norestart --nocache --wait --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\TestAgent" ` && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` && del vs_TestAgent.exe ` ` - {{InsertTemplate("Dockerfile.install-vs-buildtools", [ "usePowerShell": "true" ], " ")}} + # Install VS Build Tools + && {{InsertTemplate("Dockerfile.install-vs-buildtools", [ "usePowerShell": "true" ], " ")}} ` # Trigger dotnet first run experience by running arbitrary cmd && "%ProgramFiles%\dotnet\dotnet" help ` diff --git a/eng/readme-templates/About.sdk.md b/eng/readme-templates/About.sdk.md index 8779654d..84b7de89 100644 --- a/eng/readme-templates/About.sdk.md +++ b/eng/readme-templates/About.sdk.md @@ -2,7 +2,6 @@ This image contains the .NET Framework SDK which is comprised of the following p 1. .NET Framework Runtime 1. Visual Studio Build Tools -1. Visual Studio Test Agent 1. NuGet CLI 1. .NET Framework Targeting Packs 1. ASP.NET Web Targets diff --git a/manifest.datestamps.json b/manifest.datestamps.json index 34067fa8..0fc0d684 100644 --- a/manifest.datestamps.json +++ b/manifest.datestamps.json @@ -1,9 +1,10 @@ { "variables": { - "CurrentReleaseDateStamp": "20251014", - "RuntimeReleaseDateStamp": "$(CurrentReleaseDateStamp)", - "AspnetReleaseDateStamp": "$(CurrentReleaseDateStamp)", - "WcfReleaseDateStamp": "$(CurrentReleaseDateStamp)", + "CurrentReleaseDateStamp": "20251118", + "PreviousReleaseDateStamp": "20251014", + "RuntimeReleaseDateStamp": "$(PreviousReleaseDateStamp)", + "AspnetReleaseDateStamp": "$(PreviousReleaseDateStamp)", + "WcfReleaseDateStamp": "$(PreviousReleaseDateStamp)", "SdkReleaseDateStamp": "$(CurrentReleaseDateStamp)", "4.8-ltsc2016-Runtime-DateStamp": "$(RuntimeReleaseDateStamp)", diff --git a/manifest.versions.json b/manifest.versions.json index 08cc7241..a913c9ff 100644 --- a/manifest.versions.json +++ b/manifest.versions.json @@ -13,9 +13,11 @@ "referenceassemblies|version": "1.0.3", "servicemonitor|version": "2.0.1.10", "servicemonitor|url": "https://github.com/microsoft/IIS.ServiceMonitor/releases/download/v$(servicemonitor|version)/ServiceMonitor.exe", - "vs|version": "17.14", - "vs|testAgentUrl": "https://aka.ms/vs/17/release/vs_TestAgent.exe", - "vs|buildToolsUrl": "https://aka.ms/vs/17/release/vs_BuildTools.exe", + "vs|version": "18.0", + "vs|buildToolsUrl": "https://aka.ms/vs/stable/vs_BuildTools.exe", + "vs|ltsc2016|version": "17.14", + "vs|ltsc2016|testAgentUrl": "https://aka.ms/vs/17/release/vs_TestAgent.exe", + "vs|ltsc2016|buildToolsUrl": "https://aka.ms/vs/17/release/vs_BuildTools.exe", "4.8|url": "https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe", "4.8.1|url": "https://download.visualstudio.microsoft.com/download/pr/6f083c7e-bd40-44d4-9e3f-ffba71ec8b09/3951fd5af6098f2c7e8ff5c331a0679c/ndp481-x86-x64-allos-enu.exe" } diff --git a/src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile b/src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile index beb8a3ba..e6b722c9 100644 --- a/src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile +++ b/src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile @@ -11,7 +11,7 @@ ENV ` # NuGet version to install NUGET_VERSION=6.14.0 ` # Install location of Roslyn - ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn" + ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\Roslyn" # Install NuGet CLI RUN mkdir "%ProgramFiles%\NuGet\latest" ` @@ -19,24 +19,18 @@ RUN mkdir "%ProgramFiles%\NuGet\latest" ` && mklink "%ProgramFiles%\NuGet\latest\nuget.exe" "%ProgramFiles%\NuGet\nuget.exe" # Install VS components -RUN ` - # Install VS Test Agent - curl -fSLo vs_TestAgent.exe https://aka.ms/vs/17/release/vs_TestAgent.exe ` - && start /w vs_TestAgent --quiet --norestart --nocache --wait --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\TestAgent" ` - && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` - && del vs_TestAgent.exe ` - ` - # Install VS Build Tools - && curl -fSLo vs_BuildTools.exe https://aka.ms/vs/17/release/vs_BuildTools.exe ` +RUN curl -fSLo vs_BuildTools.exe https://aka.ms/vs/stable/vs_BuildTools.exe ` && start /w vs_BuildTools ^ ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ ` + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools" ^ ` --add Microsoft.Component.ClickOnce.MSBuild ^ ` --add Microsoft.Net.Component.4.8.1.SDK ^ ` --add Microsoft.NetCore.Component.Runtime.8.0 ^ ` --add Microsoft.NetCore.Component.Runtime.9.0 ^ ` + --add Microsoft.NetCore.Component.Runtime.10.0 ^ ` --add Microsoft.NetCore.Component.SDK ^ ` --add Microsoft.VisualStudio.Component.NuGet.BuildTools ^ ` --add Microsoft.VisualStudio.Component.WebDeploy ^ ` + --add Microsoft.VisualStudio.Component.TestTools.BuildTools ^ ` --add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup ^ ` --add Microsoft.VisualStudio.Workload.MSBuildTools ^ ` --quiet --norestart --nocache --wait ` @@ -56,14 +50,13 @@ RUN ` # Cleanup && (for /D %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do rmdir /S /Q "%i") ` && (for %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do if not "%~nxi" == "vswhere.exe" del "%~i") ` - && powershell Remove-Item -Force -Recurse "%TEMP%\*" ` - && rmdir /S /Q "%ProgramData%\Package Cache" + && powershell Remove-Item -Force -Recurse "%TEMP%\*" # Set PATH in one layer to keep image size down. RUN powershell setx /M PATH $(${Env:PATH} ` + \";${Env:ProgramFiles}\NuGet\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\Common7\IDE\Extensions\TestPlatform\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\ClickOnce\SignTool\") diff --git a/src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile b/src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile index b7e98e86..d31501ff 100644 --- a/src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile +++ b/src/sdk/4.8.1/windowsservercore-ltsc2025/Dockerfile @@ -11,7 +11,7 @@ ENV ` # NuGet version to install NUGET_VERSION=6.14.0 ` # Install location of Roslyn - ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn" + ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\Roslyn" # Install NuGet CLI RUN mkdir "%ProgramFiles%\NuGet\latest" ` @@ -19,24 +19,18 @@ RUN mkdir "%ProgramFiles%\NuGet\latest" ` && mklink "%ProgramFiles%\NuGet\latest\nuget.exe" "%ProgramFiles%\NuGet\nuget.exe" # Install VS components -RUN ` - # Install VS Test Agent - curl -fSLo vs_TestAgent.exe https://aka.ms/vs/17/release/vs_TestAgent.exe ` - && start /w vs_TestAgent --quiet --norestart --nocache --wait --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\TestAgent" ` - && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` - && del vs_TestAgent.exe ` - ` - # Install VS Build Tools - && curl -fSLo vs_BuildTools.exe https://aka.ms/vs/17/release/vs_BuildTools.exe ` +RUN curl -fSLo vs_BuildTools.exe https://aka.ms/vs/stable/vs_BuildTools.exe ` && start /w vs_BuildTools ^ ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ ` + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools" ^ ` --add Microsoft.Component.ClickOnce.MSBuild ^ ` --add Microsoft.Net.Component.4.8.1.SDK ^ ` --add Microsoft.NetCore.Component.Runtime.8.0 ^ ` --add Microsoft.NetCore.Component.Runtime.9.0 ^ ` + --add Microsoft.NetCore.Component.Runtime.10.0 ^ ` --add Microsoft.NetCore.Component.SDK ^ ` --add Microsoft.VisualStudio.Component.NuGet.BuildTools ^ ` --add Microsoft.VisualStudio.Component.WebDeploy ^ ` + --add Microsoft.VisualStudio.Component.TestTools.BuildTools ^ ` --add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup ^ ` --add Microsoft.VisualStudio.Workload.MSBuildTools ^ ` --quiet --norestart --nocache --wait ` @@ -56,14 +50,13 @@ RUN ` # Cleanup && (for /D %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do rmdir /S /Q "%i") ` && (for %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do if not "%~nxi" == "vswhere.exe" del "%~i") ` - && powershell Remove-Item -Force -Recurse "%TEMP%\*" ` - && rmdir /S /Q "%ProgramData%\Package Cache" + && powershell Remove-Item -Force -Recurse "%TEMP%\*" # Set PATH in one layer to keep image size down. RUN powershell setx /M PATH $(${Env:PATH} ` + \";${Env:ProgramFiles}\NuGet\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\Common7\IDE\Extensions\TestPlatform\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\ClickOnce\SignTool\") diff --git a/src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile b/src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile index d0ed7692..aaf12621 100644 --- a/src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile +++ b/src/sdk/4.8/windowsservercore-ltsc2016/Dockerfile @@ -46,6 +46,7 @@ RUN ` --add Microsoft.Net.Component.4.8.SDK ^ ` --add Microsoft.NetCore.Component.Runtime.8.0 ^ ` --add Microsoft.NetCore.Component.Runtime.9.0 ^ ` + --add Microsoft.NetCore.Component.Runtime.10.0 ^ ` --add Microsoft.NetCore.Component.SDK ^ ` --add Microsoft.VisualStudio.Component.NuGet.BuildTools ^ ` --add Microsoft.VisualStudio.Component.WebDeploy ^ ` diff --git a/src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile b/src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile index 2c4feadc..f8e973bc 100644 --- a/src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile +++ b/src/sdk/4.8/windowsservercore-ltsc2019/Dockerfile @@ -9,7 +9,7 @@ ENV ` # NuGet version to install NUGET_VERSION=6.14.0 ` # Install location of Roslyn - ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn" + ROSLYN_COMPILER_LOCATION="C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\Roslyn" # Install NuGet CLI RUN mkdir "%ProgramFiles%\NuGet\latest" ` @@ -17,24 +17,18 @@ RUN mkdir "%ProgramFiles%\NuGet\latest" ` && mklink "%ProgramFiles%\NuGet\latest\nuget.exe" "%ProgramFiles%\NuGet\nuget.exe" # Install VS components -RUN ` - # Install VS Test Agent - curl -fSLo vs_TestAgent.exe https://aka.ms/vs/17/release/vs_TestAgent.exe ` - && start /w vs_TestAgent --quiet --norestart --nocache --wait --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\TestAgent" ` - && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" ` - && del vs_TestAgent.exe ` - ` - # Install VS Build Tools - && curl -fSLo vs_BuildTools.exe https://aka.ms/vs/17/release/vs_BuildTools.exe ` +RUN curl -fSLo vs_BuildTools.exe https://aka.ms/vs/stable/vs_BuildTools.exe ` && start /w vs_BuildTools ^ ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ ` + --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools" ^ ` --add Microsoft.Component.ClickOnce.MSBuild ^ ` --add Microsoft.Net.Component.4.8.SDK ^ ` --add Microsoft.NetCore.Component.Runtime.8.0 ^ ` --add Microsoft.NetCore.Component.Runtime.9.0 ^ ` + --add Microsoft.NetCore.Component.Runtime.10.0 ^ ` --add Microsoft.NetCore.Component.SDK ^ ` --add Microsoft.VisualStudio.Component.NuGet.BuildTools ^ ` --add Microsoft.VisualStudio.Component.WebDeploy ^ ` + --add Microsoft.VisualStudio.Component.TestTools.BuildTools ^ ` --add Microsoft.VisualStudio.Web.BuildTools.ComponentGroup ^ ` --add Microsoft.VisualStudio.Workload.MSBuildTools ^ ` --quiet --norestart --nocache --wait ` @@ -55,14 +49,13 @@ RUN ` # Cleanup && (for /D %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do rmdir /S /Q "%i") ` && (for %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\*") do if not "%~nxi" == "vswhere.exe" del "%~i") ` - && powershell Remove-Item -Force -Recurse "%TEMP%\*" ` - && rmdir /S /Q "%ProgramData%\Package Cache" + && powershell Remove-Item -Force -Recurse "%TEMP%\*" # Set PATH in one layer to keep image size down. RUN powershell setx /M PATH $(${Env:PATH} ` + \";${Env:ProgramFiles}\NuGet\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\" ` - + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\amd64\" ` + + \";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\18\BuildTools\Common7\IDE\Extensions\TestPlatform\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\" ` + \";${Env:ProgramFiles(x86)}\Microsoft SDKs\ClickOnce\SignTool\") diff --git a/tests/Microsoft.DotNet.Framework.Docker.Tests/Config.cs b/tests/Microsoft.DotNet.Framework.Docker.Tests/Config.cs index 6aef82b5..e560ddba 100644 --- a/tests/Microsoft.DotNet.Framework.Docker.Tests/Config.cs +++ b/tests/Microsoft.DotNet.Framework.Docker.Tests/Config.cs @@ -20,6 +20,18 @@ public static class Config Environment.GetEnvironmentVariable("DOCKERFILE_PATHS")? .Split(',', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); + #nullable enable + private static JObject? _manifestVariables = null; + public static JObject ManifestVariables + { + get + { + _manifestVariables ??= GetManifestVariables(); + return _manifestVariables; + } + } + #nullable disable + public static string GetManifestRegistry() { string manifestJson = File.ReadAllText("manifest.json"); @@ -27,11 +39,11 @@ public static string GetManifestRegistry() return (string)manifest["registry"]; } - public static Version GetManifestVsVersion() + private static JObject GetManifestVariables() { string manifestJson = File.ReadAllText("manifest.versions.json"); JObject manifest = JObject.Parse(manifestJson); - return System.Version.Parse((string)(manifest["variables"]["vs|version"])); + return (JObject)manifest["variables"]; } public static string GetFilterRegexPattern(string filter) diff --git a/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptor.cs b/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptor.cs index 2aaff5f3..1f9faf2d 100644 --- a/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptor.cs +++ b/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptor.cs @@ -8,10 +8,6 @@ public class ImageDescriptor { public string Version { get; set; } public string OsVariant { get; set; } - - public string GetDockerfilePath(string imageType) => - $"src/{imageType}/{Version}/{OsVariant}"; - public string SdkVersion { get; set; } } } diff --git a/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptorExtensions.cs b/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptorExtensions.cs new file mode 100644 index 00000000..875c9142 --- /dev/null +++ b/tests/Microsoft.DotNet.Framework.Docker.Tests/ImageDescriptorExtensions.cs @@ -0,0 +1,47 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using Newtonsoft.Json.Linq; + +namespace Microsoft.DotNet.Framework.Docker.Tests; + +internal static class ImageDescriptorExtensions +{ + /// + /// The path to the Dockerfile that was used to build the image. + /// + /// "sdk", "runtime", "aspnet", or "wcf". + public static string GetDockerfilePath(this ImageDescriptor imageDescriptor, string imageType) => + $"src/{imageType}/{imageDescriptor.Version}/{imageDescriptor.OsVariant}"; + + /// + /// The expected Visual Studio version installed inside the image. + /// + public static Version GetExpectedVsVersion(this ImageDescriptor imageDescriptor) + { + JObject manifestVariables = Config.ManifestVariables; + string vsVersionVariable = imageDescriptor.OsVariant switch + { + // Visual Studio 2026/dev18 does not support Windows Server 2016. + // See https://learn.microsoft.com/visualstudio/releases/2026/compatibility + OsVersion.WSC_LTSC2016 => "vs|ltsc2016|version", + _ => "vs|version", + }; + + return Version.Parse((string)manifestVariables[vsVersionVariable]); + } + + /// + /// The expected Visual Studio installation path inside the image. + /// + public static string GetExpectedVsInstallationPath(this ImageDescriptor imageDescriptor) => + imageDescriptor.OsVariant switch + { + // Visual Studio 2026/dev18 does not support Windows Server 2016. + // See https://learn.microsoft.com/visualstudio/releases/2026/compatibility + OsVersion.WSC_LTSC2016 => @"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools", + _ => @"C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools", + }; +} diff --git a/tests/Microsoft.DotNet.Framework.Docker.Tests/SdkOnlyImageTests.cs b/tests/Microsoft.DotNet.Framework.Docker.Tests/SdkOnlyImageTests.cs index c6dd5524..2258f6ad 100644 --- a/tests/Microsoft.DotNet.Framework.Docker.Tests/SdkOnlyImageTests.cs +++ b/tests/Microsoft.DotNet.Framework.Docker.Tests/SdkOnlyImageTests.cs @@ -72,13 +72,14 @@ public void VerifyEnvironmentVariables(ImageDescriptor imageDescriptor) { Skip.If(IsSkippable(imageDescriptor)); - List variables = new List(); + string vsPath = imageDescriptor.GetExpectedVsInstallationPath(); - variables.AddRange(RuntimeOnlyImageTests.GetEnvironmentVariables(imageDescriptor)); - - variables.Add(new EnvironmentVariableInfo("ROSLYN_COMPILER_LOCATION", - @"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn")); - variables.Add(new EnvironmentVariableInfo("DOTNET_GENERATE_ASPNET_CERTIFICATE", "false")); + List variables = + [ + ..RuntimeOnlyImageTests.GetEnvironmentVariables(imageDescriptor), + new EnvironmentVariableInfo("ROSLYN_COMPILER_LOCATION", $@"{vsPath}\MSBuild\Current\Bin\Roslyn"), + new EnvironmentVariableInfo("DOTNET_GENERATE_ASPNET_CERTIFICATE", "false"), + ]; if (imageDescriptor.OsVariant != OsVersion.WSC_LTSC2016 && imageDescriptor.OsVariant != OsVersion.WSC_LTSC2019) @@ -106,13 +107,12 @@ public void VerifyVsWhereOperability(ImageDescriptor imageDescriptor) JArray json = (JArray)JsonConvert.DeserializeObject(output); Assert.Single(json); - Assert.Equal(@"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools", json[0]["installationPath"]); + Assert.Equal(imageDescriptor.GetExpectedVsInstallationPath(), json[0]["installationPath"]); // Get build version instead of a display version or semantic version because it's easier to parse and can // also seamlessly work with preview versions. Version actualVsVersion = Version.Parse(json[0]["catalog"]["buildVersion"].ToString()); - - Version expectedVsVersion = Config.GetManifestVsVersion(); + Version expectedVsVersion = imageDescriptor.GetExpectedVsVersion(); Assert.Equal(expectedVsVersion.Major, actualVsVersion.Major); Assert.Equal(expectedVsVersion.Minor, actualVsVersion.Minor);