x19
x19

Reputation: 8783

Getting an error during the deploying webapplication "Could not open Source file: Could not find a part of the path"

I got an error during the deploying my web-application. The title of error is Could not open Source file: Could not find a part of the path

'Could not open Source file: Could not find a part of the path 'E:\ARCHIVES\Projects\Main\Jahan.Handicraft\Jahan.Handicraft.Web.Mvc.UmbracoCms.App\obj\Release\AspnetCompileMerge\TempBuildDir\App_Plugins\UmbracoForms\Data\Web.config;\App_Plugins\UmbracoForms\Data\Web.config'.'.

I've used Umbraco 7.4.3 und ASP.NET MVC in my project. I'd like deploy it on localhost.

How can I solve this problem?picture of error

Upvotes: 5

Views: 4780

Answers (2)

Thomas D
Thomas D

Reputation: 422

This is a failed attempt at transforming connection strings in sublevel configurations files.

To disable this transformation, edit the publish profile under Properties\PublishProfiles and set the value of the AutoParameterizationWebConfigConnectionStrings element to false. Add the element if missing.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <!-- 
    ...
    Other settings
    ...
    -->
    <AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>
  </PropertyGroup>
</Project>

I got it from this blog (which is not mine): http://blog.aabech.no/archive/web-deploy-says-could-not-open-source-file-some-webconfig-when-you-publish-an-umbraco-site/

Upvotes: 7

fredyfx
fredyfx

Reputation: 415

Post installation

You should note that the Umbraco nuget package adds a build step to always include the Umbraco folders when you deploy using Web One-Click Publish with Visual Studio. You can see these folders in packages/UmbracoCms x.y.z/build/UmbracoCms.targets Should you need to exclude any of these folders or content, you can add a target to your .pubxml files in the properties/Publish folder. For instance if you need to exclude json data a plugin generates during production.

<Target Name="StopUmbracoFromPublishingAppPlugins" AfterTargets="AddUmbracoFilesToOutput">
    <ItemGroup>
      <FilesForPackagingFromProject Remove=".\App_Plugins\UmbracoForms\Data\**\*.*"/>
    </ItemGroup>
  </Target>

Reference: https://our.umbraco.org/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget#post-installation

Upvotes: -1

Related Questions