首页 > 解决方案 > 将 appsetting 添加到 helix 解决方案中的根 web.config 文件

问题描述

我们正在尝试弄清楚如何从 helix 功能项目中将 appsetting 添加到根网站 web.config 中。我的理解是,如果您将转换文件(例如(web.config.transform))添加到功能项目的根目录中并使用 helix gulp 脚本构建项目,则转换应该更新根配置。这个对吗?不幸的是,当我们运行 gulp 脚本时,我们得到一个错误

    [11:26:54] Starting '04-Apply-Xml-Transform'...
[11:26:55] Applying configuration transform: D:\Projects\xxxxxxx\src\Feature\Claims\code\xxxxx.Website.Feature.Claim\App_Config\Include\Web.config.transform
D:\Projects\xxxxxxx\scripts\applytransform.targets(14,5): error : Could not open Source file: Could not find a part of the path 'C:\inetpub\wwwroot\xxxxxxxxx\website\xxxxxxx.Website.Feature.Claim\App_Config\Include\Web.config'.
Process terminated with code 1.
[11:26:56] MSBuild failed with code 1!
[11:26:56] '04-Apply-Xml-Transform' errored after 1.59 s
error!
[11:26:56] Error: MSBuild failed with code 1!
    at ChildProcess.<anonymous> (D:\Projects\xxxxxxxxxxxx\node_modules\gulp-msbuild\lib\msbuild-runner.js:66:25)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

在我看来,它就像是在尝试更新本地 web.config。

标签: sitecorehelix

解决方案


您的 web.config 不会驻留在此处C:\inetpub\wwwroot\xxxxxxxxx\website\xxxxxxx.Website.Feature.Claim\App_Config\Include\Web.config

它将驻留在此处:C:\inetpub\wwwroot\xxxxxxxxx\website\Web.config


推荐阅读