My requirement is to publish the project code to a folder. I have configured the below command in the Post build event. When I build the project the post build event is executing which is rebuilding the project and triggering the post build event again and going into infinite loop. I would want to only publish but not rebuild the code on the post build event.
call "$(MSBuildBinPath)\msbuild.exe" "$(ProjectDir)$(ProjectFileName)" /p:DeployOnBuild=true /p:Configuration=Debug /p:Platform=AnyCPU /p:PublishProfile=ProdPublishProfile.pubxml