How to set current year in AssemblyInfo file?
I used
Instead of this:
>
I saw something on another post (https://stackoverflow.com/a/827209/857307) that could really be helpful here.
Try this.
Add a new file to your source repository somewhere common to all of the projects in your solution. Call the file something like AssemblyCopyright.tt
In the file, add the following code for c#
<#@ template language="C#" #>
using System;
using System.Reflection;
[assembly: AssemblyCopyright("Copyright © CompanyName <#=DateTime.Now.Year#>")]
or vb
<#@ template language="VB" #>
<#@ output extension=".vb" #>
Imports System
Imports System.Reflection
")>
Then, remove the AssemblyCopyright attribute from each of your AssemblyInfo.cs files.
Finally, add a link to the AssemblyCopyright.tt file to each of your projects.
The template file will recreate a new AssemblyCopyright.cs file on every build with the correct year.