From 3e82eaa6fcd77420facd213acbcf92d5dd546ee3 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Thu, 8 Jan 2026 14:07:18 +0530 Subject: [PATCH 01/15] .Net 10 add --- src/Common.props | 2 +- src/dev.sh | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Common.props b/src/Common.props index 19c298e182..931582764e 100644 --- a/src/Common.props +++ b/src/Common.props @@ -1,7 +1,7 @@ 10.0 - net8.0;net6.0 + net10.0;net8.0 $(PackageRuntime) true true diff --git a/src/dev.sh b/src/dev.sh index 6895eae56c..3b1ac496fe 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -34,7 +34,7 @@ fi pushd "$SCRIPT_DIR" -DEFAULT_TARGET_FRAMEWORK="net8.0" +DEFAULT_TARGET_FRAMEWORK="net10.0" if [[ $TARGET_FRAMEWORK == "" ]]; then TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK @@ -42,17 +42,18 @@ fi function get_net_version() { local dotnet_versions=" - net6.0-sdk=6.0.424 - net6.0-runtime=6.0.32 - + net8.0-sdk=8.0.416 net8.0-runtime=8.0.22 + + net10.0-sdk=10.0.101 + net10.0-runtime=10.0.1 " echo "$dotnet_versions" | grep -o "$1=[^ ]*" | cut -d '=' -f2 } -DOTNET_SDK_VERSION=$(get_net_version "net8.0-sdk") +DOTNET_SDK_VERSION=$(get_net_version "net10.0-sdk") DOTNET_RUNTIME_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-runtime") if [[ ($DOTNET_SDK_VERSION == "") || ($DOTNET_RUNTIME_VERSION == "") ]]; then @@ -121,17 +122,17 @@ function warn_about_newer_versions() { local runtime_outdated=false # Get latest SDK version from official .NET feed - latest_sdk=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Sdk/8.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") + latest_sdk=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") if [[ -z "$latest_sdk" ]]; then # Fallback to backup feed - latest_sdk=$(curl -s "https://ci.dot.net/public/Sdk/8.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_SDK_VERSION") + latest_sdk=$(curl -s "https://ci.dot.net/public/Sdk/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_SDK_VERSION") fi # Get latest Runtime version from official .NET feed - latest_runtime=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Runtime/8.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") + latest_runtime=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") if [[ -z "$latest_runtime" ]]; then # Fallback to backup feed - latest_runtime=$(curl -s "https://ci.dot.net/public/Runtime/8.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_RUNTIME_VERSION") + latest_runtime=$(curl -s "https://ci.dot.net/public/Runtime/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_RUNTIME_VERSION") fi # Check SDK version @@ -145,7 +146,7 @@ function warn_about_newer_versions() { fi if [[ "$sdk_outdated" == "true" || "$runtime_outdated" == "true" ]]; then - echo "⚠️ WARNING: Newer .NET 8.0 versions available:" >&2 + echo "⚠️ WARNING: Newer .NET 10.0 versions available:" >&2 if [[ "$sdk_outdated" == "true" ]]; then echo " SDK: $latest_sdk (currently using $DOTNET_SDK_VERSION)" >&2 fi From b016bbec5d7dc97f7e224839e7c8a6d358c20ac3 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Wed, 28 Jan 2026 11:50:52 +0530 Subject: [PATCH 02/15] Agent build with net8.0 and net10.0 --- src/Common.props | 5 ++++- src/dev.sh | 18 +++++++++++------- src/dir.proj | 22 ++++++++++++---------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/Common.props b/src/Common.props index 931582764e..d91a621ce8 100644 --- a/src/Common.props +++ b/src/Common.props @@ -1,7 +1,10 @@ 10.0 - net10.0;net8.0 + $(NetTargetFramework) + net10.0 + $(NetRuntimeFrameworkVersion) + 10.0.1 $(PackageRuntime) true true diff --git a/src/dev.sh b/src/dev.sh index 3b1ac496fe..5ddb7a15b6 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -53,7 +53,7 @@ function get_net_version() { echo "$dotnet_versions" | grep -o "$1=[^ ]*" | cut -d '=' -f2 } -DOTNET_SDK_VERSION=$(get_net_version "net10.0-sdk") +DOTNET_SDK_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-sdk") DOTNET_RUNTIME_VERSION=$(get_net_version "${TARGET_FRAMEWORK}-runtime") if [[ ($DOTNET_SDK_VERSION == "") || ($DOTNET_RUNTIME_VERSION == "") ]]; then @@ -116,23 +116,26 @@ function restore_sdk_and_runtime() { function warn_about_newer_versions() { echo "" + # Extract major version from TARGET_FRAMEWORK (e.g., net10.0 -> 10.0, net8.0 -> 8.0) + local dotnet_major_version="${TARGET_FRAMEWORK#net}" + # Use official .NET APIs to get latest versions local latest_sdk latest_runtime local sdk_outdated=false local runtime_outdated=false # Get latest SDK version from official .NET feed - latest_sdk=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") + latest_sdk=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Sdk/${dotnet_major_version}/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") if [[ -z "$latest_sdk" ]]; then # Fallback to backup feed - latest_sdk=$(curl -s "https://ci.dot.net/public/Sdk/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_SDK_VERSION") + latest_sdk=$(curl -s "https://ci.dot.net/public/Sdk/${dotnet_major_version}/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_SDK_VERSION") fi # Get latest Runtime version from official .NET feed - latest_runtime=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") + latest_runtime=$(curl -s "https://builds.dotnet.microsoft.com/dotnet/Runtime/${dotnet_major_version}/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "") if [[ -z "$latest_runtime" ]]; then # Fallback to backup feed - latest_runtime=$(curl -s "https://ci.dot.net/public/Runtime/10.0/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_RUNTIME_VERSION") + latest_runtime=$(curl -s "https://ci.dot.net/public/Runtime/${dotnet_major_version}/latest.version" 2>/dev/null | tail -n 1 | tr -d '\r\n' || echo "$DOTNET_RUNTIME_VERSION") fi # Check SDK version @@ -146,7 +149,7 @@ function warn_about_newer_versions() { fi if [[ "$sdk_outdated" == "true" || "$runtime_outdated" == "true" ]]; then - echo "⚠️ WARNING: Newer .NET 10.0 versions available:" >&2 + echo "⚠️ WARNING: Newer .NET ${dotnet_major_version} versions available:" >&2 if [[ "$sdk_outdated" == "true" ]]; then echo " SDK: $latest_sdk (currently using $DOTNET_SDK_VERSION)" >&2 fi @@ -484,9 +487,10 @@ REPORT_DIR="${REPO_ROOT}/_reports/${RUNTIME_ID}" restore_dotnet_install_script restore_sdk_and_runtime + heading ".NET SDK to path" echo "Adding .NET SDK to PATH (${DOTNET_DIR})" -export PATH=${DOTNET_DIR}:$PATH +export PATH=${DOTNET_DIR}/sdk/${DOTNET_SDK_VERSION}:${DOTNET_DIR}:$PATH export PATH=${NUGET_DIR}:$PATH echo "Path = $PATH" echo ".NET Version = $(dotnet --version)" diff --git a/src/dir.proj b/src/dir.proj index d4368522f4..a70d81baf0 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -66,21 +66,22 @@ BuildInParallel="false" Projects="@(ProjectFiles)" SkipNonExistentProjects="false" - StopOnFirstFailure="true" /> + StopOnFirstFailure="true" + Properties="NetTargetFramework=$(TargetFramework);NetRuntimeFrameworkVersion=$(RuntimeFrameworkVersion)" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=$(AgentVersion);RuntimeIdentifier=$(PackageRuntime);PublishDir=$(LayoutRoot)/bin;TreatWarningsAsErrors=$(TreatWarningsAsErrors);NetTargetFramework=$(TargetFramework);NetRuntimeFrameworkVersion=$(RuntimeFrameworkVersion)" /> - - - + + + @@ -91,18 +92,19 @@ BuildInParallel="false" Projects="@(ProjectFiles)" SkipNonExistentProjects="false" - StopOnFirstFailure="true" /> + StopOnFirstFailure="true" + Properties="NetTargetFramework=$(TargetFramework);NetRuntimeFrameworkVersion=$(RuntimeFrameworkVersion)" /> + Properties="Configuration=$(BUILDCONFIG);PackageRuntime=$(PackageRuntime);Version=1.0.0.0;RuntimeIdentifier=$(PackageRuntime);PublishDir=$(L1Root)/bin;NetTargetFramework=$(TargetFramework);NetRuntimeFrameworkVersion=$(RuntimeFrameworkVersion)" /> - - - + + + From 29dc78771c6b275e7988435c3f8254611d54e037 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Wed, 28 Jan 2026 11:54:07 +0530 Subject: [PATCH 03/15] Update pipeline to support both net8.0 and net10.0 --- .azure-pipelines/build-job.yml | 4 ++-- .azure-pipelines/pipeline.yml | 4 ++-- .vsts.release.yml | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 76d4b4977f..fbe90d833f 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -84,10 +84,10 @@ jobs: ${{ if eq(parameters.targetFramework, 'all') }}: strategy: matrix: - NET6.0: - targetFramework: 'net6.0' NET8.0: targetFramework: 'net8.0' + NET10.0: + targetFramework: 'net10.0' ${{ if ne(parameters.container, '') }}: diff --git a/.azure-pipelines/pipeline.yml b/.azure-pipelines/pipeline.yml index 533c4d1cea..5ec3b57b8f 100644 --- a/.azure-pipelines/pipeline.yml +++ b/.azure-pipelines/pipeline.yml @@ -113,10 +113,10 @@ extends: ${{ if eq(parameters.targetFramework, 'all') }}: strategy: matrix: - NET6.0: - targetFramework: 'net6.0' NET8.0: targetFramework: 'net8.0' + NET10.0: + targetFramework: 'net10.0' pool: name: 1ES-ABTT-Shared-Pool image: abtt-ubuntu-2404 diff --git a/.vsts.release.yml b/.vsts.release.yml index 8a0a4fba98..c22f740607 100644 --- a/.vsts.release.yml +++ b/.vsts.release.yml @@ -27,9 +27,10 @@ parameters: - name: targetFramework displayName: Target framework type: string - default: net8.0 + default: net10.0 values: - net8.0 + - net10.0 - name: derivedFrom type: string @@ -145,9 +146,9 @@ extends: ## Verify target framework for specified version $majorVersion = $agentVersion.Split('.')[0] - if (("${{ parameters.targetFramework }}" -eq "net6.0" -and $majorVersion -ne "3") -or - ("${{ parameters.targetFramework }}" -eq "net8.0" -and $majorVersion -ne "4")) { - Write-Error "The major version should be 3 for net6.0 and 4 for net8.0" -ErrorAction Stop + if (("${{ parameters.targetFramework }}" -eq "net8.0" -and $majorVersion -ne "4") -or + ("${{ parameters.targetFramework }}" -eq "net10.0" -and $majorVersion -ne "5")) { + Write-Error "The major version should be 4 for net8.0 and 5 for net10.0" -ErrorAction Stop } } if ($isTestRun) { From 41cac64b4342475b25a52972bc9e509f1b7c56e0 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Wed, 28 Jan 2026 14:53:27 +0530 Subject: [PATCH 04/15] Update ci pipleine to build both .Net versions --- .azure-pipelines/build-job.yml | 18 +++++++++++++----- .vsts.ci.yml | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index fbe90d833f..24a7d2f6d7 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -113,6 +113,13 @@ jobs: CheckoutBranch: ${{ parameters.branch }} ${{ if ne(parameters.targetFramework, 'all') }}: targetFramework: ${{ parameters.targetFramework }} + # Map target framework to dotnet versions + ${{ if eq(variables['targetFramework'], 'net8.0') }}: + dotnetRuntimeVersionRange: '8.0.x' + dotnetSdkVersion: '8.0.416' + ${{ if eq(variables['targetFramework'], 'net10.0') }}: + dotnetRuntimeVersionRange: '10.0.x' + dotnetSdkVersion: '10.0.101' templateContext: outputs: - ${{ if or(parameters.unitTests, parameters.functionalTests) }}: @@ -181,9 +188,9 @@ jobs: - ${{ if parameters.unitTests }}: - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - task: UseDotNet@2 - displayName: Install .NET Core 6 Runtime + displayName: 'Install .NET Runtime - $(targetFramework)' inputs: - version: '6.0.x' + version: $(dotnetRuntimeVersionRange) packageType: 'runtime' installationPath: 'C:\Program Files (x86)\dotnet' env: @@ -197,9 +204,9 @@ jobs: - ${{ if parameters.functionalTests }}: - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - task: UseDotNet@2 - displayName: Install .NET Core 6 SDK + displayName: 'Install .NET SDK - $(targetFramework)' inputs: - version: '6.0.424' + version: $(dotnetSdkVersion) packageType: sdk performMultiLevelLookup: true - script: ${{ variables.devCommand }} testl1 $(targetFramework) Debug ${{ parameters.os }}-${{ parameters.arch }} @@ -233,9 +240,10 @@ jobs: - ${{ if eq(parameters.os, 'osx') }}: - task: UseDotNet@2 + displayName: 'Install .NET SDK - $(targetFramework)' inputs: packageType: 'sdk' - version: '6.0.x' + version: $(dotnetSdkVersion) - ${{ if parameters.sign }}: # Signing steps diff --git a/.vsts.ci.yml b/.vsts.ci.yml index db5383ee84..fc146f0f9f 100644 --- a/.vsts.ci.yml +++ b/.vsts.ci.yml @@ -61,7 +61,7 @@ extends: publishArtifacts: ${{ ne(variables['Build.Reason'], 'PullRequest') }} buildAlternatePackage: false testProxyAgent: ${{ parameters.testProxyAgent }} - targetFramework: 'net8.0' + targetFramework: 'all' win_x64: ${{ parameters.win_x64 }} win_x86: ${{ parameters.win_x86 }} win_arm64: ${{ parameters.win_arm64 }} From 33ad6b8304b4d54ee246f820e78d869e110b2e92 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Sun, 1 Feb 2026 01:05:56 +0530 Subject: [PATCH 05/15] fix L0 test --- .azure-pipelines/build-job.yml | 18 +++++------------- src/Test/Test.csproj | 6 +++--- src/dev.sh | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/build-job.yml b/.azure-pipelines/build-job.yml index 24a7d2f6d7..fbe90d833f 100644 --- a/.azure-pipelines/build-job.yml +++ b/.azure-pipelines/build-job.yml @@ -113,13 +113,6 @@ jobs: CheckoutBranch: ${{ parameters.branch }} ${{ if ne(parameters.targetFramework, 'all') }}: targetFramework: ${{ parameters.targetFramework }} - # Map target framework to dotnet versions - ${{ if eq(variables['targetFramework'], 'net8.0') }}: - dotnetRuntimeVersionRange: '8.0.x' - dotnetSdkVersion: '8.0.416' - ${{ if eq(variables['targetFramework'], 'net10.0') }}: - dotnetRuntimeVersionRange: '10.0.x' - dotnetSdkVersion: '10.0.101' templateContext: outputs: - ${{ if or(parameters.unitTests, parameters.functionalTests) }}: @@ -188,9 +181,9 @@ jobs: - ${{ if parameters.unitTests }}: - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - task: UseDotNet@2 - displayName: 'Install .NET Runtime - $(targetFramework)' + displayName: Install .NET Core 6 Runtime inputs: - version: $(dotnetRuntimeVersionRange) + version: '6.0.x' packageType: 'runtime' installationPath: 'C:\Program Files (x86)\dotnet' env: @@ -204,9 +197,9 @@ jobs: - ${{ if parameters.functionalTests }}: - ${{ if and(eq(parameters.os, 'win'), eq(parameters.arch, 'x86')) }}: - task: UseDotNet@2 - displayName: 'Install .NET SDK - $(targetFramework)' + displayName: Install .NET Core 6 SDK inputs: - version: $(dotnetSdkVersion) + version: '6.0.424' packageType: sdk performMultiLevelLookup: true - script: ${{ variables.devCommand }} testl1 $(targetFramework) Debug ${{ parameters.os }}-${{ parameters.arch }} @@ -240,10 +233,9 @@ jobs: - ${{ if eq(parameters.os, 'osx') }}: - task: UseDotNet@2 - displayName: 'Install .NET SDK - $(targetFramework)' inputs: packageType: 'sdk' - version: $(dotnetSdkVersion) + version: '6.0.x' - ${{ if parameters.sign }}: # Signing steps diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 855520ce47..1e021ae844 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/src/dev.sh b/src/dev.sh index 5ddb7a15b6..cd03b37cf8 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -393,7 +393,7 @@ function cmd_report() { # for some reason CodeCoverage.exe will only write the output file in the current directory pushd $COVERAGE_REPORT_DIR >/dev/null - "${HOME}/.nuget/packages/microsoft.codecoverage/16.4.0/build/netstandard1.0/CodeCoverage/CodeCoverage.exe" analyze "/output:coverage.xml" "$LATEST_COVERAGE_FILE" + "${HOME}/.nuget/packages/microsoft.codecoverage/18.0.1/build/netstandard1.0/CodeCoverage/CodeCoverage.exe" analyze "/output:coverage.xml" "$LATEST_COVERAGE_FILE" popd >/dev/null if ! command -v reportgenerator.exe >/dev/null; then From 358d0b84404d74cf577d562b7617f4531fab28e8 Mon Sep 17 00:00:00 2001 From: Rajani Priya Mishra Date: Tue, 3 Feb 2026 15:08:45 +0530 Subject: [PATCH 06/15] Update csproj to include packages that can be pruned only for .net8 --- src/Agent.Listener/Agent.Listener.csproj | 8 ++++---- src/Agent.PluginHost/Agent.PluginHost.csproj | 8 ++++---- src/Agent.Plugins/Agent.Plugins.csproj | 6 +++--- src/Agent.Sdk/Agent.Sdk.csproj | 12 ++++++------ src/Agent.Worker/Agent.Worker.csproj | 6 +++--- .../Microsoft.VisualStudio.Services.Agent.csproj | 10 +++++----- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Agent.Listener/Agent.Listener.csproj b/src/Agent.Listener/Agent.Listener.csproj index 2ba302e683..054af5d767 100644 --- a/src/Agent.Listener/Agent.Listener.csproj +++ b/src/Agent.Listener/Agent.Listener.csproj @@ -17,15 +17,15 @@ - + - - - + + + diff --git a/src/Agent.PluginHost/Agent.PluginHost.csproj b/src/Agent.PluginHost/Agent.PluginHost.csproj index a1f399343b..82ed710e7c 100644 --- a/src/Agent.PluginHost/Agent.PluginHost.csproj +++ b/src/Agent.PluginHost/Agent.PluginHost.csproj @@ -11,12 +11,12 @@ - + - - - + + + diff --git a/src/Agent.Plugins/Agent.Plugins.csproj b/src/Agent.Plugins/Agent.Plugins.csproj index 1d88f68007..a6ff5413af 100644 --- a/src/Agent.Plugins/Agent.Plugins.csproj +++ b/src/Agent.Plugins/Agent.Plugins.csproj @@ -17,8 +17,8 @@ - - - + + + diff --git a/src/Agent.Sdk/Agent.Sdk.csproj b/src/Agent.Sdk/Agent.Sdk.csproj index dd8f45e512..1b8c808421 100644 --- a/src/Agent.Sdk/Agent.Sdk.csproj +++ b/src/Agent.Sdk/Agent.Sdk.csproj @@ -8,21 +8,21 @@ - + - + - - - + + + - + \ No newline at end of file diff --git a/src/Agent.Worker/Agent.Worker.csproj b/src/Agent.Worker/Agent.Worker.csproj index 1beec9b6c7..8838dea66e 100644 --- a/src/Agent.Worker/Agent.Worker.csproj +++ b/src/Agent.Worker/Agent.Worker.csproj @@ -18,8 +18,8 @@ - - - + + + diff --git a/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj b/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj index a48413526f..13007a25a9 100644 --- a/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj +++ b/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj @@ -12,17 +12,17 @@ - + - - + + - - + + From 69bce17dcbffd17b82c24a0c5a01bd4f724ff673 Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 15:52:35 +0530 Subject: [PATCH 07/15] Fix .NET 8 build and L1 test execution - Add System.Threading.Tasks.Dataflow package reference to fix NU1605 package downgrade error for .NET 8 builds - Add DOTNET_ROOT export to ensure tests use local SDK runtime (10.0.1) instead of global - Add target framework validation to catch invalid values like '.net8.0' early with helpful error message --- .../Microsoft.VisualStudio.Services.Agent.csproj | 1 + src/dev.sh | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj b/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj index 13007a25a9..c582c3edd1 100644 --- a/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj +++ b/src/Microsoft.VisualStudio.Services.Agent/Microsoft.VisualStudio.Services.Agent.csproj @@ -23,6 +23,7 @@ + diff --git a/src/dev.sh b/src/dev.sh index cd03b37cf8..cf0f218a18 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -40,6 +40,12 @@ if [[ $TARGET_FRAMEWORK == "" ]]; then TARGET_FRAMEWORK=$DEFAULT_TARGET_FRAMEWORK fi +# Validate target framework - only allow known values +ALLOWED_FRAMEWORKS=("net8.0" "net10.0") +if [[ ! " ${ALLOWED_FRAMEWORKS[*]} " =~ " ${TARGET_FRAMEWORK} " ]]; then + failed "Invalid target framework '${TARGET_FRAMEWORK}'. Allowed values: ${ALLOWED_FRAMEWORKS[*]}" +fi + function get_net_version() { local dotnet_versions=" @@ -492,7 +498,9 @@ heading ".NET SDK to path" echo "Adding .NET SDK to PATH (${DOTNET_DIR})" export PATH=${DOTNET_DIR}/sdk/${DOTNET_SDK_VERSION}:${DOTNET_DIR}:$PATH export PATH=${NUGET_DIR}:$PATH +export DOTNET_ROOT=${DOTNET_DIR} echo "Path = $PATH" +echo "DOTNET_ROOT = $DOTNET_ROOT" echo ".NET Version = $(dotnet --version)" heading "Pre-caching external resources for $RUNTIME_ID" From 2fc5ab26597d42950d0e181b5b45bdcbe67c2e67 Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 17:27:56 +0530 Subject: [PATCH 08/15] Fix DOTNET_ROOT path format for Windows Convert DOTNET_ROOT to Windows-style path (C:\path) on Windows platform so that native dotnet test commands can locate the correct runtime. --- src/dev.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dev.sh b/src/dev.sh index cf0f218a18..29473bbab9 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -498,7 +498,18 @@ heading ".NET SDK to path" echo "Adding .NET SDK to PATH (${DOTNET_DIR})" export PATH=${DOTNET_DIR}/sdk/${DOTNET_SDK_VERSION}:${DOTNET_DIR}:$PATH export PATH=${NUGET_DIR}:$PATH -export DOTNET_ROOT=${DOTNET_DIR} + +# Set DOTNET_ROOT - on Windows, convert to Windows-style path for native dotnet commands +if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then + # Convert /c/path to C:\path format for Windows + local dotnet_root_windows=${DOTNET_DIR:1} + dotnet_root_windows=${dotnet_root_windows:0:1}:${dotnet_root_windows:1} + dotnet_root_windows=$(echo "$dotnet_root_windows" | sed 's|/|\\|g') + export DOTNET_ROOT="$dotnet_root_windows" +else + export DOTNET_ROOT=${DOTNET_DIR} +fi + echo "Path = $PATH" echo "DOTNET_ROOT = $DOTNET_ROOT" echo ".NET Version = $(dotnet --version)" From e22957d276847a020361681408682718b8cd3a93 Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 17:32:37 +0530 Subject: [PATCH 09/15] Add dotnet diagnostics to TestL1 target in dir.proj Print dotnet location (where/which), DOTNET_ROOT, and available runtimes before running tests to help troubleshoot runtime resolution issues. --- src/dir.proj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dir.proj b/src/dir.proj index a70d81baf0..18d383e1c5 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -104,6 +104,16 @@ + + + + + + + + + + From eac2017e28a28c44d1281b61a3c70cc23d7e9fb4 Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 17:55:28 +0530 Subject: [PATCH 10/15] Fix REPO_ROOT to use absolute path without '..' The testhost was failing to find the .NET runtime because DOTNET_ROOT contained '..' which wasn't being resolved correctly. Using 'cd && pwd' ensures we get a clean absolute path that the runtime host can use. --- src/dev.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dev.sh b/src/dev.sh index 29473bbab9..f3a1cf6f37 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -20,7 +20,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/.helpers.sh" -REPO_ROOT="${SCRIPT_DIR}/.." +# Resolve REPO_ROOT to absolute path without '..' for proper runtime resolution +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" AGENT_VERSION=$(cat "$SCRIPT_DIR/agentversion" | head -n 1 | tr -d "\n\r") DOTNET_ERROR_PREFIX="##vso[task.logissue type=error]" From fe05225c5fde00f2d1f1f995770ecfa1693f718b Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 18:07:00 +0530 Subject: [PATCH 11/15] Pass DOTNET_ROOT to dotnet test via EnvironmentVariables The testhost process wasn't finding the runtime because DOTNET_ROOT set in bash wasn't being inherited by child processes spawned by MSBuild. Use the Exec task's EnvironmentVariables attribute to explicitly pass DOTNET_ROOT to ensure the testhost can locate the .NET runtime. --- src/dir.proj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index 18d383e1c5..e6c6611ee9 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -15,6 +15,7 @@ $(MSBuildProjectDirectory)/../_l1 + $(MSBuildProjectDirectory)/../_dotnetsdk true @@ -111,10 +112,12 @@ + - + + From 7f203393f602a41993445af1abebd3d7a0e46aaf Mon Sep 17 00:00:00 2001 From: azure-pipelines-bot Date: Wed, 4 Feb 2026 18:07:53 +0530 Subject: [PATCH 12/15] remove local --- src/dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev.sh b/src/dev.sh index f3a1cf6f37..7c5ae80355 100755 --- a/src/dev.sh +++ b/src/dev.sh @@ -503,7 +503,7 @@ export PATH=${NUGET_DIR}:$PATH # Set DOTNET_ROOT - on Windows, convert to Windows-style path for native dotnet commands if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then # Convert /c/path to C:\path format for Windows - local dotnet_root_windows=${DOTNET_DIR:1} + dotnet_root_windows=${DOTNET_DIR:1} dotnet_root_windows=${dotnet_root_windows:0:1}:${dotnet_root_windows:1} dotnet_root_windows=$(echo "$dotnet_root_windows" | sed 's|/|\\|g') export DOTNET_ROOT="$dotnet_root_windows" From fe8315a251b71075b612be5bb5ec31875c2db639 Mon Sep 17 00:00:00 2001 From: Tarun Ramsinghani Date: Wed, 4 Feb 2026 18:45:23 +0530 Subject: [PATCH 13/15] Fix L1 tests: Exclude testhost.exe to ensure proper DOTNET_ROOT resolution The native testhost.exe was probing for .NET runtime next to itself instead of respecting DOTNET_ROOT. By excluding build assets from Microsoft.TestPlatform.TestHost, VSTest falls back to using dotnet testhost.dll which properly respects DOTNET_ROOT. --- src/Test/Test.csproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 1e021ae844..eefe3aa47b 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -18,7 +18,11 @@ - + + + build + From f1e84ea8a93748fb209280102c2ddac58da89093 Mon Sep 17 00:00:00 2001 From: Tarun Ramsinghani Date: Wed, 4 Feb 2026 18:52:54 +0530 Subject: [PATCH 14/15] Remove debugging artifacts from dir.proj The testhost.exe DOTNET_ROOT issue is now fixed in Test.csproj by excluding build assets. Removed diagnostic echo commands, DotNetSdkRoot property, and EnvironmentVariables workaround that are no longer needed. --- src/dir.proj | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/dir.proj b/src/dir.proj index e6c6611ee9..cd3c2351f7 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -15,7 +15,6 @@ $(MSBuildProjectDirectory)/../_l1 - $(MSBuildProjectDirectory)/../_dotnetsdk true @@ -106,18 +105,7 @@ - - - - - - - - - - - - + From d53036fbd8f6285edb267f2079ad26ada5035f1d Mon Sep 17 00:00:00 2001 From: Tarun Ramsinghani Date: Wed, 4 Feb 2026 18:54:51 +0530 Subject: [PATCH 15/15] fix --- src/dir.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dir.proj b/src/dir.proj index cd3c2351f7..a70d81baf0 100644 --- a/src/dir.proj +++ b/src/dir.proj @@ -104,7 +104,6 @@ -