ShP
ShP

Reputation: 1143

MSBuild Batch File - Custom Task Parameter

How can I access custom parameter in my MSBuild?

For example, this is a call:

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

And I want to access in task like this:

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

...or anyhow, just like a variable sent trough the batch file while I'm calling MSBuild.exe

Upvotes: 0

Views: 457

Answers (1)

ShP
ShP

Reputation: 1143

Solved the issue:

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

This need to be defined outside of task.

Upvotes: 0

Related Questions