History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2779
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Steve Luo
Reporter: Phong Trinh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

The Environment Variable setting in MSBuild step doesn't work.

Created: 08/Aug/16 10:38 PM   Updated: 01/Dec/16 07:23 AM
Component/s: None
Affects Version/s: 6.1.14
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
 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

 All   Comments   Work Log   Change History      Sort Order:
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.

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.

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.