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
The dotnet CLI (via System.CommandLine) reads environment variables named `{COMMAND}ARGUMENTS` and silently injects their content into the parsed arguments for that subcommand. Because Azure DevOps automatically exposes all pipeline variables as uppercased environment variables, a pipeline variable named `runArguments` becomes `RUNARGUMENTS`, which `dotnet run` reads and injects into the application's `args[]` — bypassing the `--` separator.
116
+
117
+
**Forbidden variable names** (any casing):
118
+
-`runArguments` — injected into `dotnet run`
119
+
-`buildArguments` — injected into `dotnet build`
120
+
-`testArguments` — injected into `dotnet test`
121
+
- Any name matching `{dotnet-subcommand}Arguments`
122
+
123
+
**Use instead**: `dotnetBuildOpts`, `dotnetRunOpts`, `stressTestArgs`, or other names that do not match the `{COMMAND}ARGUMENTS` pattern.
124
+
125
+
This affects ALL .NET SDK versions (8.0+). The injection is invisible in `[command]` log lines, making it extremely hard to diagnose. The only symptom is the application receiving unexpected arguments.
126
+
113
127
## Conventions When Editing Pipelines
114
128
115
129
- Always use templates for reusable logic — do not inline complex steps
Copy file name to clipboardExpand all lines: src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Common/Attributes/GlobalExceptionHandlerAttribute.cs
Copy file name to clipboardExpand all lines: src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Common/Attributes/GlobalTestCleanupAttribute.cs
Copy file name to clipboardExpand all lines: src/Microsoft.Data.SqlClient/tests/StressTests/SqlClient.Stress.Common/Attributes/GlobalTestSetupAttribute.cs
0 commit comments