MSBuild Integration

The Microsoft Build Engine (MSBuild) is the build platform for Microsoft and Visual Studio. This page explains how to integrate Agile.net into the MSBuild process.

  • Using Agile.NET UI tool create a project file. Add assemblies to the project file from the \obj\Release folder, and NOT from \bin\Release.
  • Using an XML editor (or notepad) edit your project file (.csproj or .vbproj), before editing the project file should look as follows:

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <PropertyGroup>

    ...

    </PropertyGroup>

    <Reference>

    ...

    </Reference>

    <ItemGroup>

    ...

    </ItemGroup>

    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets.

    <Target Name="BeforeBuild">

    </Target>

    <Target Name="AfterBuild">

    </Target>

    -->

    </Project>

  • Add the following lines after the <Import Project> block:

    <!-- START AgileDotNet START -->

    <PropertyGroup>

    <AgileDotNetLocation>"C:\Program Files (x86)\SecureTeam\AgileDotNet.Console.exe"</AgileDotNetLocation>

    <AgileDotNetProjectFile>"$(ProjectDir)\Protect.cls"</AgileDotNetProjectFile>

    </PropertyGroup>

    <Target Name="AfterCompile" Condition=" '$(Configuration)' == 'Release' ">

    <Exec Command="$(AgileDotNetLocation) /project:$(AgileDotNetProjectFile)" />

    </Target>

    <!-- END AgileDotNet END -->

  • Note that the following properties must be defined:

    AgileDotNetLocation - path to the Agile.NET .Console.exe file.

    AgileDotNetProjectFile - path to the Agile.NET project created in the first step.