views:

29

answers:

1

Hi,

I would like to do something like this:

<PropertyGroup>
<propone>value</propone>
</PropertyGroup>

<PropertyGroup>
<proptwo>$(propone)</proptwo>
</PropertyGroup>

Pass one property value as another. Is there a way to do this? How?

+1  A: 

I think you provided the answer right there in your question: yes, it is possible in just the way that you suggested.

An example:

<Project ToolsVersion="3.5" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <PropertyGroup>
    <SomeProperty>Some Property Value</SomeProperty>
  </PropertyGroup>
  <PropertyGroup>
    <SomeOtherProperty>$(SomeProperty) with something added to it</SomeOtherProperty>
  </PropertyGroup>
  <Target Name="Test">
    <Message Text="$(SomeOtherProperty)" />
  </Target>
</Project>

This will print Some Property Value with something added to it.

Fredrik Mörk
ok, the issue was somwhere else. I was calling property before import tag. :( My fault but the answer is right and gave me a clue to search bug somewhere else. Thanks!
truthseeker