Search code examples
msbuildmonoxbuild

How to pass variable in a project file to the "MSBuild" task


We are using a project file, which then calls MSBuild task. For example,

<Target Name="Clean">
  <MSBuild Targets="Clean" Projects="@(Solution)"/>
</Target>

In the project file I now define a variable which I want to pass to MSBuild task.


Solution

  • I found it out by myself! This works:

    <Target Name="Clean">
      <MSBuild Targets="Clean" Projects="@(Solution)" Properties="Key=Value"/>
    </Target>