sitecore - 将 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。
解决方案
您的 web.config 不会驻留在此处C:\inetpub\wwwroot\xxxxxxxxx\website\xxxxxxx.Website.Feature.Claim\App_Config\Include\Web.config
它将驻留在此处:C:\inetpub\wwwroot\xxxxxxxxx\website\Web.config
推荐阅读
- python - 在 Pandas 数据帧上计算重叠滚动窗口中的数据
- javascript - 在 CubeJS 中实现 DISTINCT ON
- python - Dataset.from_generator:TypeError:`generator` 必须是可调用的
- javascript - 不同的条件,相同的结果。为什么?
- node.js - 在heroku上部署后,Web应用程序显示空白页面?
- typescript - TS2531:对象可能是“空”,即使我检查它不是
- swift - 在 Swift 属性包装器中公开字典
- javascript - 如何使用node命令一个接一个地运行多个.js文件?
- c# - 如何在 Unity 2020 中使用 Hybrid Renderer V2 从 Burstable ForEach 作业中动态显示或隐藏网格?
- google-chrome - 什么可能导致对话框弹出 chrome 上的会话丢失?