How can I use a web.config
transform to include the domain attribute in my production web.config
?
I have the following in my base web.config
.
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
I have tried to use the following in my web.prod.config
, but it doesn't add the attribute when I publish the project.
<authentication mode="Forms" xdt:Transform="Replace">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com" />
</authentication>
I would like the output to be the following.
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com"/>
</authentication>
One of these two should work (untested, but based on Microsoft's documentation):
<system.web>
<authentication mode="Forms" xdt:Transform="Replace" xdt:Locator="Match(forms)">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com" />
</authentication>
</system.web>
<system.web>
<authentication mode="Forms">
<forms domain=".mydomain.com" xdt:Transform="SetAttributes(domain)" />
</authentication>
</system.web>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With