So basically I am using msdeploy in order to deploy a site to IIS. I am using the msdeploy console. My script is something like that
msdeploy -verb:sync -source:contentPath="c:\Site1" -dest:contentPath="c:\Site2"
The problem is that I want to preserve the error message I get.
I tried with running cmd.exe with the msdeploy command script followed by > error.txt. This way I can get the info if the deployment is successful but when there is an error the error.txt file is empty....
Is there a way to get that error in a file or inside C# code?