开发者

Is there a possibility to use one property value inside another?

I would like to do something like this:

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

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

Pass one pro开发者_运维百科perty value as another. Is there a way to do this? How?


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">
  <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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜