You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: Explicit configuration value overwritten by environment variable since .NET SDK 11 #57243
dotnet build/publish -p:Configuration=X is ignored when the CONFIGURATION environment variable is set. -c X works; SDK 10.0.404 works.
SDK
Command
Result
11.0.100
-p:Configuration=Debug, env CONFIGURATION=Release
obj/Release ❌ (Expected Debug)
11.0.100
-c Debug, env CONFIGURATION=Release
obj/Debug ✔
11.0.100
-p:Configuration=Debug, без env
obj/Debug ✔
10.0.404
-p:Configuration=Debug, env CONFIGURATION=Release
obj/Debug ✔
Steps to reproduce
dotnet new classlib -f net10.0 -o repro
cd repro
$env:CONFIGURATION = 'Release'
dotnet build -p:Configuration=Debug
Expected behavior
Release notes states that an explicit command-line option still takes precedence, and empty or whitespace-only environment values are ignored. So -p:Configuration also should take precedence over environment variable.
Actual behavior
Explicit -p:Configuration value overwritten by environment variable.
Is this a regression?
Yes. May also documented as breaking changes if this is desired сhanges.
Are there any workarounds?
Change p:Configuration=X to -c X to keep explicit configuration value X.
dotnet --info output
.NET SDK: Version: 11.0.100 Commit: 297acf930f Workload version: 11.0.100-manifests.073a2387 MSBuild version: 18.12.2-1.26529.118+297acf930Runtime Environment: OS Name: Windows OS Version: 10.0.28120 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\11.0.100
➡️ Summary: In SDK 11.0.100, -p:Configuration=Debug is overridden by a CONFIGURATION environment variable, unlike 10.0.404 and -c. Investigate the environment-variable handling change and decide whether to fix or document it.
Generated by 🏷️ Issue Triage for #57243 · copilot · auto (Claude Sonnet 5.5) · ~16 AIC · ⌖ ~2 AIC · ⊞ 15.5K · ◷
As I can see possible culprit is #55431, the intention was to use the Configuration environment variable as the default value of the -c/--configuration option, but I think this override of -p:Configuration=Debug was not intentional
Activity
github-actions commentedon Nov 20, 2026
🎯 Agentic Issue Triage
Triage Assessment:
medium- Area is the strongest interpretation, but no CODEOWNERS section matches Area-CLI; MSBuild-level handling is plausible.Similar issues: #52358 (
potentially related)➡️ Summary: In SDK 11.0.100, -p:Configuration=Debug is overridden by a CONFIGURATION environment variable, unlike 10.0.404 and -c. Investigate the environment-variable handling change and decide whether to fix or document it.
dotnet-policy-service commentedon Nov 20, 2026
Refer to the .NET SDK breaking change guidelines
marcpopMSFT commentedon Nov 24, 2026
@dotnet/kitten @baronfel what is the expected behavior here? Should the CLI command override the environment variable?
OvesN commentedon Nov 25, 2026
@marcpopMSFT Yes, expected behavior here is that CLI command overrides the env variable, as stated in docs.
OvesN commentedon Nov 25, 2026
As I can see possible culprit is #55431, the intention was to use the Configuration environment variable as the default value of the -c/--configuration option, but I think this override of -p:Configuration=Debug was not intentional