DEV Community

Automate those pesky copyright dates in your csproj files.

Just add this bit of xml to somewhere near the top of the csproj file.

<PropertyGroup>
    <!-- dynamic -->
    <Year>$([System.DateTime]::Now.Year.ToString())</Year>
</PropertyGroup>
Enter fullscreen mode Exit fullscreen mode

In the section where the Copyright tag is change that to

<PropertyGroup>
    <Copyright>Company Name (c) $(Year) All Rights Reserved</Copyright>
Enter fullscreen mode Exit fullscreen mode

There you go - no more annoying check ins to update the copyright date, ever.

Easy Peasy

I am not a lawyer. I do not play a lawyer on the Internet or anywhere for that matter. This notice may not be the exact notice you need to be legally covered.

Top comments (0)