I want to have a date when an application was deployed/published in my Web.Config.
Is there a way to achieve that with web.config transformations?
With xdt:Transform="Replace"
I can replace any node with predefined value, but is there a way to use some custom function to calculate that value (like DateTime.Now
)?
I don't think you can do this with the config transforms (although I'm not 100% certain).
I would suggest using the MSBuild Extension Pack which contains a DateAndTime task to get the current Date and a Detokenise task to perform token replacement on a file.
You could then either:
Hope that helps.
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