My .csproj defines the following post build event in the .csproj file that regenerates a symbolic link. This works fine inside with a manual Visual Studio build and the symlink gets regenerated without issue:
<PostBuildEvent>
del C:\foo\foo\bin\debug\my.config
mklink C:\bar\bar\bar\bar\bar\bar\bin\debug\my.config c:\baz\baz\my.config
</PostBuildEvent>
However, I am trying to set up continuous integration using TFS2015 with automated builds using MSBuild, however in this case, the build fails with 'the command mklink C:\bar\bar\bar\bar\bar\bar\bin\debug\my.config c:\baz\baz\my.config exited with code 1'.
How do I go about regenerating a symbolic link via an automated build?