I want set this attribute only in release mode:
<system.web>
<httpCookies domain=".mySite.com" />
</system.web>
This is my Web.Release.Config:
<system.web>
<httpCookies name="someName" domain=".mySite.com" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</system.web>
and this is my Web.Config:
<system.web>
<httpCookies name="someName"/>
</system.web>
But the httpCookies property not have name attribute!!! and get error that this attribute not valid.
This should work - add this to your Web.Release.config file:
<system.web>
<httpCookies domain=".mySite.com" xdt:Transform="Replace" />
</system.web>
You don't need the name attribute (it doesn't exist anyway)
This will be the result in the transformed web.config:
<system.web>
<httpCookies domain=".mySite.com" />
</system.web>
Note that the httpCookies
element must be present in your Web.config file for the transform to work.
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