<< Back to previous view |
[QB-2779] The Environment Variable setting in MSBuild step doesn't work.
|
|
Status: | Closed |
Project: | QuickBuild |
Component/s: | None |
Affects Version/s: | 6.1.14 |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | Phong Trinh | Assigned To: | Steve Luo |
Resolution: | Won't Fix | Votes: | 0 |
Remaining Estimate: | Unknown | Time Spent: | Unknown |
Original Estimate: | Unknown |
Description |
Support Team,
I tried to set the environment variable in the MSBuild step, but it doesn't work for me. Please look into this issue. Thank you, ptrinh |
Comments |
Comment by Steve Luo [ 10/Aug/16 02:21 PM ] |
I can't reproduce this issue with below example:
msbuild.xml: <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <BuildProperty>$(BuildVersion}</BuildProperty> </PropertyGroup> <Target Name="TestMessage" AfterTargets="Build" > <!--Use $(Property Name) to reference a property--> <Message Text="Build version is: $(BuildProperty)" Importance="high"/> </Target> </Project> And then I added an environment variable for property BuildProperty in the MSBuild Step: BuildProperty ${build.version} from the log, I can see the message contains the build version correctly. |
Comment by Phong Trinh [ 10/Aug/16 02:39 PM ] |
- In the MSBuild step, I added the follow to 'Environment Variables':
Name = Path Value = C:\<new path to a software>;${node.getAttribute("yourAttributeName")} - I then list the 'Path' in the Post-Execution Action, but I did not see the new path. |
Comment by Steve Luo [ 11/Aug/16 01:38 AM ] |
Hi,
You can't use environment variables in the Post-Execution script. The environment variables are only used for QuickBuild to invoke msbuild command. You have to add the variables manually in your script. |