richardszalay / helix-publishing-pipeline

Unified publishing for Sitecore Helix solutions that extends existing Visual Studio and command line workflows
MIT License
68 stars 18 forks source link

Web.Helix.config transforms also do transforms on /Views/Web.config #34

Closed jeneaux closed 5 years ago

jeneaux commented 5 years ago

As discussed on Slack, Helix transforms are being applied to Web.config, and also Views/Web.config, like so:

Foundation/Module/code/Web.Helix.config exists (contains an node)

Project/MyWebsite/code/Web.config exists Project/MyWebsite/code/Views/Web.config exists (the Main layout for the site lives here in Views)

HPP (1.4.0) is added to MyWebsite project, with default settings. I've configured publish-on-build with a publish profile which copies files locally. After a build, the end result is my nodes being added to both Web.config and Views/Web.config

I believe the Views/Web.config is being included as a candidate for transformation by the CollectWebConfigsToTransform target in Microsoft.Web.Publishing.targets, so not sure if this is an issue with HPP or should be resolved in another way.

I resolved the issue locally by modifying my MyWebsite project to add a target to PreTransformWebConfigDependsOn which explicitly removed Views/Web.config from the WebConfigsToTransform identity.

richardszalay commented 5 years ago

Resolved and published as 1.4.1