Tuesday, 10 September 2013

Could not open Source file: Could not find a part of the path Web.config; \umbraco\Xslt\Web.config'

I am using Team city as my build server, and web deploy in order to create my deploy package.

I have received error message:

My error message that is on Build server

[09:31:02]Step 1/1: Publish & Deploy (MSBuild) (47s)
[09:31:05][Step 1/1] Website.Web.UI\Website.Web.UI.csproj.teamcity: Build targets: Build;Package (45s)
[09:31:50][Website.Web.UI\Website.Web.UI.csproj.teamcity] AutoParameterizationWebConfigConnectionStringsCore
[09:31:50][AutoParameterizationWebConfigConnectionStringsCore] ParameterizeTransformXml
[09:31:50][ParameterizeTransformXml] D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(2352, 5): Could not open Source file: Could not find a part of the path 'D:\41fe9571fcaca9a1\Website.Web.UI\umbraco\Xslt\Web.config;

[09:31:50][Website.Web.UI\Website.Web.UI.csproj.teamcity] Project Website.Web.UI\Website.Web.UI.csproj.teamcity failed.
[09:31:50][Step 1/1] Step Publish & Deploy (MSBuild) failed

I have found 2 cases which cause this error.

This happens because of web.deploy is running web.config transformation changes. By default the web.config is set to build as content.

Solution 1 - Svn issue

Issue has been that I have had 2 sources loading data.
One:Source check out from repository
Second:Artefacts used from previous steps.

Use only one source for build and error goes away.

Solution 2 - Web.config transform

Find the file in your solution(project). in my case it is:"D:\41fe9571fcaca9a1\Website.Web.UI\umbraco\Xslt\Web.config".
Go to the properties of the file (Alt + Enter)

Update your configuration.

Set your "Build Action" to  None or Content

This means that there will be no transform on this config, usual configuration is compile.