0

如何在我的 MSBuild 中访问自定义参数?

例如,这是一个调用:

 msbuild.exe /t:CustomTask /p:CustomParameterName="Some Value Here"

我想访问这样的任务:

<Target Name="CustomTask">  
  <PropertyGroup>
    <CustomParameterName>NONE</CustomParameterName>
  </PropertyGroup>
  <Message Text="Parameter Value: $(CustomParameterName)" Importance="high" />
</task>

...或者无论如何,就像我调用 MSBuild.exe 时通过批处理文件发送的变量一样

4

1 回答 1

0

解决了这个问题:

<PropertyGroup> <CustomParameterName>NONE</CustomParameterName> </PropertyGroup>

这需要在任务之外定义。

于 2015-03-25T15:27:05.100 回答