Share this Post

Owais Shaikh's Blog

Recent Posts

Using xsl and msxsl with msdeploy you can generate formatted html logs. It gets even better when you use the API; you can generate better organized logs with custom messages to suit your needs. Before we start, you can download msxsl for free from here and the web deployment tool (msdeploy) from here (x86 / x64 )

Using the MSDeploy.exe:

I have a simple xsl that shows the files or directories or anything that is either added, deleted, modified or skipped in a table format. The xml spew that is generated by specifying –xml switch to msdeploy can be piped into msxsl along with the attached xsl file and then this can be opened in internet explorer or a browser of your choice all in one command. The xsl can be modified to output non xml output. For this you can look at the part III of the post.

The following command creates a package of the webserver while skipping all asp files in the server and pipes the xml output to msxsl. Msxsl uses the piped xml and applies the msdeploy.xsl to it to generate out.html which is opened by the browser.

You can download the xsl file from here. (Its currently named msdeploy.xsl.txt since uploading xsl files is not allowed. Make sure to rename it to xsl before using it)

Using the MSDeploy API:

An xsl similar to the one above is used. For getting formatted output from the API you need to do the following: You can download the the visual studio solution for this from here

1. Add traceeventhandler to the source and / or destination base options. Tracelevel needs to be verbose to get skipped object and replace rule traces. The default tracelevel is info which gives just the DeploymentObjectChangedEventArgs.