I have following target on csproj file using VS2012, i want to run "Publish" on the project once the build has finished.
This gives me following error "error MSB4006: There is a circular dependency in the target dependency graph involving target "AfterBuild""
<Target Name="AfterBuild">
<Message Text="Running Publish..." Importance="high"/>
<MSBuild Projects="$(ProjectPath)" Properties="DeployOnBuild=true;PublishProfile=WebDeploy;CreatePackageOnPublish=True;VisualStudioVersion=11.0"/>
</Target>
i have tried replacing the MSBuild step with
<Exec Command="$(MSBuildBinPath)\MSBuild C:\MyProj.csproj /p:DeployOnBuild=true /p:PublishProfile=WebDeploy /p:CreatePackageOnPublish=True /p:VisualStudioVersion=11.0" ContinueOnError="false" />
Doing above results in build/publish being run over and over.
i have tried naming target different, calling it via another target to no avail.
How can i run "Publish" on the project without getting into repeated cycles? can this be done in another way?