在部署网络应用程序期间出现错误 "Could not open Source file: Could not find a part of the path"

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

我在部署 web-application 时遇到错误。 错误的标题是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'.'.

我在我的项目中使用了 Umbraco 7.4.3ASP.NET MVC。 我想在本地主机上部署它。

我该如何解决这个问题?

Post安装

您应该注意到 Umbraco nuget 包添加了一个构建步骤,以便在您使用带有 Visual Studio 的 Web 一键发布进行部署时始终包含 Umbraco 文件夹。 您可以在 packages/UmbracoCms x.y.z/build/UmbracoCms.targets 中看到这些文件夹 如果您需要排除任何这些文件夹或内容,您可以将目标添加到 properties/Publish 文件夹中的 .pubxml 文件。例如,如果您需要排除插件在生产过程中生成的 json 数据。

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

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

尝试转换子级别配置文件中的连接字符串失败。

要禁用此转换,请编辑 Properties\PublishProfiles 下的发布配置文件并将 AutoParameterizationWebConfigConnectionStrings 元素的值设置为 false。如果缺少元素,请添加。

<?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>

我从这个博客(不是我的)得到的:http://blog.aabech.no/archive/web-deploy-says-could-not-open-source-file-some-webconfig-when-you-publish-an-umbraco-site/