[release/11.0.1xx-preview7] Honor Configuration environment variable in CLI options - #55452
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72bf4a4e-15d3-4177-9246-c49ad3071b13
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72bf4a4e-15d3-4177-9246-c49ad3071b13
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 72bf4a4e-15d3-4177-9246-c49ad3071b13
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
| IsDynamic = true, | ||
| DefaultValueFactory = _ => | ||
| { | ||
| string? configuration = Environment.GetEnvironmentVariable("Configuration"); |
There was a problem hiding this comment.
What if I have the following setup?
- Configuration env variable set to
Release. - Solution with two projects:
- ProjectA: Typical project like the template console app.
- ProjectB: It has explicit
<Configuration>Debug</Configuration>
Are we introducing a behavior change for ProjectB before vs after this change?
There was a problem hiding this comment.
B never used Configuration in that case I believe - the environment variable would already override, because MSBuild read it from the env var.
There was a problem hiding this comment.
Thank you both. Resolving the thread
There was a problem hiding this comment.
@baronfel I tested on this csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Configuration>Debug</Configuration>
</PropertyGroup>
</Project>
On current SDK without this PR:
It looks like Configuration from csproj is winning (Note that I'm building csproj right away, the behavior is likely to be different when dealing with solution).
The change in this PR will make the same scenario use Release instead of Debug.
|
/ba-g PR #55452 is a backport that only touches CLI option definitions: The build failed on 2 Helix work items (exit code 2), with these failures: 1. FullFramework windows — Console-encoding issue: expected 2. dotnet.Tests windows — 8 failures, all in ( The error signatures all point to the run-file build cache returning stale/wrong output:
This is a test-isolation/caching flakiness pattern in file-based apps, with an established history in the repo (e.g. #54813 "Flaky: RunFileTests_* intermittently fail", #54819, #55057 "handle deleted artifacts directory"). None of it exercises the CLI option code the PR modifies. |
Backport of #55431 to release/11.0.1xx-preview7
/cc @Evangelink