Web Deploy says "Could not open Source file ... some web.config" when you publish an Umbraco site

We use Visual Studio and Web Deploy to deploy most of our sites manually.
Every now and then a project won't deploy claiming that it "Could not open Source file ... some web.config".
Turns out this is actually a failed attempt at transforming connection strings in sublevel configurations files, that more often than not doesn't contain connection strings.
In our solutions, we mainly use the root web.config xsd transforms Visual Studio provides instead of having Web Deploy configure our connections.
So the feature that blocks the deployment is actually a feature we don't use. :)
But the feature can also be turned off. The way to go about it is to locate the relevant .pubxml file under /Properties/PublishProfiles in your project.
Somewhere in the /Project/PropertyGroup element we need to add

<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>

I like to put it just before the <PublishDatabaseSettings> element since they seem to be related.
Just to be on the safe side, I also tend to make sure all the /PublishDatabaseSettings/Objects/ObjectGroup elements also has Enabled="False" even though I'm sure the first step already did the trick. Guess it's OCD rearing it's familiar face.

Author

comments powered by Disqus