【发布时间】:2026-01-28 02:55:01
【问题描述】:
如何使用web.config 转换将域属性包含在我的产品web.config 中?
我的基地web.config 中有以下内容。
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
我尝试在我的web.prod.config 中使用以下内容,但在我发布项目时它没有添加属性。
<authentication mode="Forms" xdt:Transform="Replace">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com" />
</authentication>
我希望输出如下。
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com"/>
</authentication>
【问题讨论】:
-
这与您的问题无关,但域名真的是
=".mydomain.com"而不是="mydomain.com"...期间应该在那里吗? -
谢谢,是的,点应该在那里,这将满足子域的需求,但还是非常感谢。
标签: .net asp.net authentication web-config web-config-transform