After following the guidance found here, I've implemented a pre-build process designed to dynamical update assembly copyright.
The template for the copyright is
<#@ template language="C#" #>
<#@ output extension=".cs" #>
using System;
using System.Reflection;
[assembly: AssemblyCopyright("Copyright © <#=DateTime.Now.Year#>")]
If I save the file in VS, the resulting file (and compiled assembly) correctly contains the copyright symbol (©). When done as a part of the pre-build calling TextTransform.exe (in this case v12.0), the resulting file contains '?' instead. I get the same results specifying encoding="us-ascii"
When the encoding is set to any of the utf variants, it comes out as '�'. Modifying the template to use \u00A9 gives the same results when the assembly is compiled.
I'm aware I can work on incorporating code generation in the solution build process, but this adds a burden on new hires (and new environment setup; we do a lot of development in VMs) insuring the appropriate SDKs are installed. It's also requires manual intervention for every project using the template (our group does a lot of different projects in a year with many of them requiring multi-year on-going maintenance). The process also forces a regeneration for every build (the pre-build event generates to a temp file and compares for differences before attempting to overwrite). And finally, the results from this path seem to be the same as with the pre-build event.
What other options am I missing?