Is there a way to look for a pattern in aspx/ascx files and replace it with a build number or some other token? I’m not interested in using reflection and setting the string at runtime. I’d like to go into the aspx/ascx files and replace the string using msbuild.
Is this possible?
There’s a project called MSBuild Community Tasks that contains a FileUpdateTask. This should satisfy your requirement. It allows you to make arbitrary text replacements using regular expressions.
Please note that I haven’t tested this regular expression.