Last year I implemented this solution https://stackoverflow.com/a/19314275/1166898 to automatically update the copyright notice when the project is built, but I found out this year that the template isn't run unless it's changed, and it warns me that it's not trusted before running it.
How do I
.tt
fileIf it's not possible, what's a better way of updating the copyright year automatically?
There's a surprisingly easy way using Property Functions in your.csproj;
<PropertyGroup>
<Copyright>My Company $([System.DateTime]::Now.Year)</Copyright>
</PropertyGroup>
So long as you haven't set <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
, then the usual set of assembly attributes will be generated for you from MSBuild properties. See the documentation for more info.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.