I want to build the code using MSbuild Script in Jenkins. My code repository is on Visual Studio Online. The below script does not copy anything in the output folder on my local machine. Whereas if I am using the same script on my local machine it works fine. Below is the script I am using for my build:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<BuildArtifactsDir Include="D:\Jenkins\jobs\Test\workspace\BuildArtifacts\"/>
<TeamFoundationServerUrl Include="https://XXX.visualstudio.com/DefaultCollection/XXX-XXX/"/>
<SolutionFile Include="$(TeamFoundationServerUrl)*.sln"/>
</ItemGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)'=='' ">Release</Configuration>
<BuildPlatForm Condition="'$(BuildPlatForm)'=='' ">Any CPU</BuildPlatForm>
</PropertyGroup>
<Target Name="Compile" DependsOnTargets="Init">
<MSBuild Projects="@(SolutionFile)" Targets="Rebuild"
Properties="OutDir=%(BuildArtifactsDir.FullPath);Configuration=$(Configuration);Platform=$(BuildPlatform)"/>
</Target>
<Target Name="Init">
<MakeDir Directories="@(BuildArtifactsDir)"/>
</Target>
My Environment:
Jenkins: On my local host. MSBuild Plugin in Jenkins. Visual Studio Online for Code repository.