如果缺少,Umbraco 自动生成 web.config

发布于 2025-01-15 03:03:34 字数 973 浏览 4 评论 0原文

我们有一个引用 Umbraco.Web.UI 的 Umbraco 网站,

<Reference Include="Umbraco.Web.UI, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\UmbracoCms.Web.8.12.2\lib\net472\Umbraco.Web.UI.dll</HintPath>
</Reference>

如果我们看到 Umbraco.Web.UI 的源代码,那么我们会看到有一个生成 web 的复制操作.config 来自 web.Template.config。

https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj#L369

但据我所知,如果我只是参考Umbraco.Web.UI.dll 那么 Umbraco.Web.UI.dll 中的这些 MSBuild 操作将不会运行。

我的问题是,如果我构建项目并且 web.config 丢失,那么如何生成 web.config 。

问题是我们已经从存储库中删除了 web.config,并且我们想了解此 web.config 是如何生成的,以便我们可以在部署时对其进行修改。

We have a Umbraco website that references Umbraco.Web.UI,

<Reference Include="Umbraco.Web.UI, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\UmbracoCms.Web.8.12.2\lib\net472\Umbraco.Web.UI.dll</HintPath>
</Reference>

If we see the source code of Umbraco.Web.UI, then we see there is copy action that generates web.config from web.Template.config.

https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj#L369

But as far as I know if I just reference Umbraco.Web.UI.dll then these MSBuild actions in Umbraco.Web.UI.dll will not run.

My question is that how come web.config is generated if I build the project and web.config is missing.

The problem is that we have removed web.config from the repository and we wanna to understand how this web.config is generated so that we can modify it when we deploy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡の花香 2025-01-22 03:03:34

所以我的 csproj 正在使用,

<Import Project="..\packages\UmbracoCms.8.12.2\build\UmbracoCms.targets"

并且 UmbracoCms.targets 有以下操作

在此处输入图像描述

So my csproj is using,

<Import Project="..\packages\UmbracoCms.8.12.2\build\UmbracoCms.targets"

and UmbracoCms.targets have the below action

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文