microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

IIS Web App Deploy (Preview) Task can prevent IIS from starting up #4889

Closed komby closed 7 years ago

komby commented 7 years ago

When using the IIS Web App Deploy (Preview) Task and selecting the XML Transformation option

For transformations that use xdt:Transform="Replace" to replace whole sections of the XML instead of just swapping property values, the output file contains all the XML from the Transform file in one line with no whitespace or newlines/formatting.

For some of our configuration files this is causing issues preventing IIS from starting up the web app. If I edit the web.config (the transformed one in the IIS Site) directly and add the whitespace the site will startup.

see attached for an example of the transformation files

bugfiles.zip

asranja commented 7 years ago

Thanks for pointing out the issue to us @komby .

Can you try adding the attribute xml:space="preserve" to the XML tag where you want the whitespaces to be preserved in your transformation config file (Web.Test.config in your bugfiles.zip).

So it would look something like this .

Let us know the outcome.

komby commented 7 years ago

I tried adding the system.identityModel xml:space="preserve" as listed above

The transformation does run successfully and does preserve the whitespace in the transformed XML But it leaves behind the following markup

IIS does not start with this in the markup. Removing the d2p1:space="preserve" xmlns:d2p1="http://www.w3.org/XML/1998/namespace" manually and re-saving the deployed file IIS does startup as expected.
asranja commented 7 years ago

Can you please send us the full release logs after setting the variable system.debug = true to RM_Customer_Queries at Microsoft dot com (without the xml:space attribute).

Also, please attach the config files and the result.

vincent1173 commented 7 years ago

@komby , sorry for the delayed response. We have identified the cause of the issue and working on the fix . #5312

vincent1173 commented 7 years ago

This issue is resolved and the fix will be available in the 0.0.24 task version