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
Used environment variable analyzer behavior differs: If assignment happened outside the target the message appears and when in the target it does not. From the BC0103 rule documentation I am unable to figure out whether this is expected behavior or a bug.
Steps to Reproduce
Create a project env_var.proj with following content:
Build with analyzers: MSBuild.exe .\env_var.proj /m:1 /analyze /t:Hello
Expected Behavior
Build outputs
MSBuild.exe .\env_var.proj /m:1 /analyze /t:Hello
MSBuild version 17.12.0-dev-24373-01+8b03742aa for .NET Framework
Build started 7/23/2024 4:43:07 PM.
The BuildCheck is enabled for this build.
C:\Users\alinama\work\shared-ouput\env-var\env_var.proj (3,5): https://aka.ms/buil
dcheck/codes#BC0103 - Property is derived from environment variable: 'TEST' with v
alue: 'test'. Properties should be passed explicitly using the /p option.
Project "C:\Users\alinama\work\shared-ouput\env-var\env_var.proj" on node 1 (Hello
target(s)).
Hello:
test
Done Building Project "C:\Users\alinama\work\shared-ouput\env-var\env_var.proj" (H
ello target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Actual Behavior
Build outputs
Build started 7/23/2024 4:43:26 PM.
The BuildCheck is enabled for this build.
Project "C:\Users\alinama\work\shared-ouput\env-var\env_var.proj" on node 1 (Hello
target(s)).
Hello:
test
Done Building Project "C:\Users\alinama\work\shared-ouput\env-var\env_var.proj" (H
ello target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.60
Analysis
If assignment happened outside the target, the output consists of the BC0103 message:
What is interesting is that we have BC0103 test that checks the assignment in the target, and it throws the message BC0103. I am yet unsure what is exactly different in these two cases and brings such difference.
Versions & Configurations
No response
The text was updated successfully, but these errors were encountered:
Issue Description
Used environment variable analyzer behavior differs: If assignment happened outside the target the message appears and when in the target it does not. From the BC0103 rule documentation I am unable to figure out whether this is expected behavior or a bug.
Steps to Reproduce
env_var.proj
with following content:$env:TEST="test"
MSBuild.exe .\env_var.proj /m:1 /analyze /t:Hello
Expected Behavior
Build outputs
Actual Behavior
Build outputs
Analysis
If assignment happened outside the target, the output consists of the BC0103 message:
What is interesting is that we have BC0103 test that checks the assignment in the target, and it throws the message BC0103. I am yet unsure what is exactly different in these two cases and brings such difference.
Versions & Configurations
No response
The text was updated successfully, but these errors were encountered: