Repository navigation
Remove DOTNET_MULTILEVEL_LOOKUP environment variable settings - #3612
Conversation
Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
Co-authored-by: jkotas <[email protected]>
…ests/DotnetArchitectureSwitchTests.cs
…ests/DotnetArchitectureSwitchTests.cs
…ests/DotnetArchitectureSwitchTests.cs
…ests/DotnetArchitectureSwitchTests.cs
|
@jkoritzinsky This is ready for review |
There was a problem hiding this comment.
Pull request overview
This PR systematically removes the DOTNET_MULTILEVEL_LOOKUP environment variable settings across the .NET repository. The variable was previously used to prevent .NET from searching for SDKs and runtimes in global locations (like Program Files), ensuring build determinism by forcing use of locally installed .NET tooling.
Key Changes:
- Removed environment variable assignments from all build and developer workflow scripts
- Cleaned up test utilities that previously set this variable for test isolation
- Updated activation/deactivation scripts to no longer manage this variable
- Removed the variable from environment filter lists in SDK tasks
Reviewed changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/wpf/start-vs.cmd | Removed environment variable setting from VS launch script |
| src/wpf/eng/copy-wpf.ps1 | Updated comment to remove reference; removed variable assignment |
| src/winforms/start-vs.cmd | Removed environment variable setting from VS launch script |
| src/winforms/start-code.cmd | Removed environment variable setting from VS Code launch script |
| src/vstest/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs | Removed variable from test execution environment |
| src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetHostArchitectureVerifierTests.cs | Removed variable from test environment dictionaries |
| src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetArchitectureSwitchTests.cs | Removed variable from multiple test environment configurations |
| src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetArchitectureSwitchTests.Windows.cs | Removed variable from Windows-specific architecture tests |
| src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/Build.cs | Removed variable from test environment setup |
| src/vstest/scripts/test.ps1 | Removed variable assignment from test script |
| src/sourcelink/.devcontainer/devcontainer.json | Removed variable from dev container configuration |
| src/source-build-reference-packages/test.sh | Removed export statement |
| src/source-build-reference-packages/src/externalPackages/src/vs-solutionpersistence/tools/Install-DotNetSdk.ps1 | Removed variable from environment setup |
| src/source-build-reference-packages/build.sh | Removed export statement |
| src/sdk/test/Microsoft.NET.TestFramework/TestContext.cs | Removed variable from test environment setup in two locations |
| src/sdk/src/Tasks/sdk-tasks/EnvironmentVariableFilter.cs | Removed variable from environment filter whitelist |
| src/sdk/eng/restore-toolset.sh | Removed variable from generated build environment script |
| src/sdk/eng/restore-toolset.ps1 | Removed variable from generated build environment scripts (both .bat and .ps1) |
| src/sdk/build/RunTestsOnHelix.cmd | Removed variable setting from Helix test script |
| src/sdk/.devcontainer/devcontainer.json | Removed variable from dev container configuration |
| src/runtime/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs | Removed variable from process environment setup |
| src/runtime/src/mono/wasm/Wasm.Build.Tests/Common/RunCommand.cs | Removed variable initialization |
| src/runtime/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs | Removed variable from environment dictionary |
| src/runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/load-corefx-testhost.ps1 | Removed variable from SDK environment setup |
| src/runtime/src/libraries/Common/tests/System/Net/StressTests/build-local.sh | Removed export statement |
| src/runtime/src/libraries/Common/tests/System/Net/StressTests/build-local.ps1 | Removed variable assignment |
| src/runtime/eng/testing/RunnerTemplate.sh | Removed variable export and associated comment |
| src/runtime/eng/testing/RunnerTemplate.cmd | Removed variable setting and associated comment |
| src/runtime/eng/pipelines/common/macos-sign-with-entitlements.yml | Removed variable from pipeline environment |
| src/runtime/eng/build.ps1 | Removed variable setting and associated comment from VS launch setup |
| src/runtime/dotnet.sh | Removed export and associated comment |
| src/runtime/dotnet.cmd | Removed variable setting and associated comment |
| src/runtime/.devcontainer/wasm/devcontainer.json | Removed variable from dev container, cleaned up trailing commas |
| src/runtime/.devcontainer/wasm-multiThreaded/devcontainer.json | Removed variable from dev container, cleaned up trailing commas |
| src/runtime/.devcontainer/libraries/devcontainer.json | Removed variable from dev container |
| src/runtime/.devcontainer/devcontainer.json | Removed variable from dev container |
| src/runtime/.devcontainer/android/devcontainer.json | Removed variable from dev container |
| src/razor/startvs.ps1 | Removed variable setting and associated comment |
| src/razor/start-code.cmd | Removed variable setting and associated comment |
| src/razor/activate.sh | Removed variable export, unset, and associated comments |
| src/razor/activate.ps1 | Removed variable setting, removal, and associated comments |
| src/nuget-client/test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildIntegrationTestFixture.cs | Removed variable from test environment |
| src/nuget-client/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs | Removed variable from command execution environment |
| src/nuget-client/scripts/perftests/PerformanceTestUtilities.ps1 | Removed variable assignment and cleanup |
| src/nuget-client/configure.sh | Removed export and pipeline variable setting |
| src/nuget-client/configure.cmd | Removed variable setting |
| src/nuget-client/build/common.ps1 | Removed pipeline and local variable settings |
| src/msbuild/eng/restore-toolset.sh | Removed variable from generated build environment script |
| src/msbuild/eng/restore-toolset.ps1 | Removed variable from generated build environment scripts |
| src/fsharp/start-vs-FsharpSln.cmd | Removed variable setting and associated comment |
| src/efcore/startvs.cmd | Removed variable setting and associated comment |
| src/efcore/activate.sh | Removed variable export, unset, and associated comments |
| src/efcore/activate.ps1 | Removed variable setting, removal, and associated comments |
| src/diagnostics/start-vscode.sh | Removed export and associated comment |
| src/diagnostics/src/tests/CommonTestRunner/TestRunner.cs | Removed variable from process runner environment |
| src/diagnostics/src/SOS/SOS.UnitTests/SOSRunner.cs | Removed variable from process runner environment (2 locations) |
| src/diagnostics/src/Microsoft.Diagnostics.TestHelpers/DotNetBuildDebuggeeTestStep.cs | Removed variable from build and restore runners |
| src/diagnostics/dotnet.sh | Removed export and associated comment |
| src/diagnostics/dotnet.cmd | Removed variable setting and associated comment |
| src/diagnostics/.devcontainer/devcontainer.json | Removed variable from dev container |
| src/aspnetcore/startvscode.sh | Removed export and associated comment |
| src/aspnetcore/startvscode.cmd | Removed variable setting and associated comment |
| src/aspnetcore/startvs.cmd | Removed variable setting and associated comment |
| src/aspnetcore/src/submodules/MessagePack-CSharp/tools/Install-DotNetSdk.ps1 | Removed variable from environment setup |
| src/aspnetcore/src/ProjectTemplates/scripts/startvs.cmd | Removed variable setting and associated comment |
| src/aspnetcore/eng/helix/content/runtests.sh | Removed export and associated comment |
| src/aspnetcore/eng/helix/content/runtests.cmd | Removed variable setting |
| src/aspnetcore/activate.sh | Removed variable export, unset, and associated comments |
| src/aspnetcore/activate.ps1 | Removed variable setting, removal, and associated comments |
| src/aspnetcore/.devcontainer/devcontainer.json | Removed variable from dev container |
| src/arcade/eng/common/tools.sh | Removed export, pipeline variable setting, and associated comments |
| src/arcade/eng/common/tools.ps1 | Removed variable setting, pipeline variable setting, and associated comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just let me know if you want this merged. I can merge over the currently failing validation job. |
|
@ViktorHofer It would be great if you can merge this. Thank you! |
Plan to Remove DOTNET_MULTILEVEL_LOOKUP Environment Variable
Summary
Successfully removed DOTNET_MULTILEVEL_LOOKUP environment variable settings from the repository (with scope adjustments per feedback):
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.