VDimensions.MSBuild.Sdk.Copyrighting 0.8.35

dotnet add package VDimensions.MSBuild.Sdk.Copyrighting --version 0.8.35
                    
NuGet\Install-Package VDimensions.MSBuild.Sdk.Copyrighting -Version 0.8.35
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VDimensions.MSBuild.Sdk.Copyrighting" Version="0.8.35">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VDimensions.MSBuild.Sdk.Copyrighting" Version="0.8.35" />
                    
Directory.Packages.props
<PackageReference Include="VDimensions.MSBuild.Sdk.Copyrighting">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VDimensions.MSBuild.Sdk.Copyrighting --version 0.8.35
                    
#r "nuget: VDimensions.MSBuild.Sdk.Copyrighting, 0.8.35"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VDimensions.MSBuild.Sdk.Copyrighting@0.8.35
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VDimensions.MSBuild.Sdk.Copyrighting&version=0.8.35
                    
Install as a Cake Addin
#tool nuget:?package=VDimensions.MSBuild.Sdk.Copyrighting&version=0.8.35
                    
Install as a Cake Tool

VDimensions.MSBuild.Sdk.Copyrighting

Ensures that the project's copyright information, the assembly copyright information that is built into the output dll files, and the copyright information of the nuget package are aligned.

The Problem

MSBuild uses separate properties to express the same infomation:

Property Purpose
$(Authors) Authors of the package, part of the nuget package properties
$(Company) The company that produces the binaries, part of the nuget package properties
$(AssemblyCompany) Embedded in the binary output of the project
$(AssemblyCopyright) Embedded in the binary output of the project, expresses a copyright notice

It is up to the developer to specify each these by hand, and most people often overlook them. There is no sensible fallback that allows one to define only $(Company), and expect that $(AssemblyCompany) assumes the same value. To MSBuild those are separate properties.

Developers have to know what is the purpose of each properties and to provide all of them in order to configure their projects correctly.

The Solution

This package adds an MSBuild target that would align these 4 properties in the following way:

  • Unless explicitly set, $(Company) will assume the value of $(Authors)
  • Unless explicitly set, $(AssemblyCompany) will assume the value of $(Company). This will take into account the previous step, so if both $(Company) and $(AssemblyCompany) were not defined, they will now assume the value of $(Authors)

In addition to the above rules, this package will auto-evaluate $(AssemblyCopyright) if not provided by your project as follows.

  1. First, it will evaluate the current year. This happens during the build phase of your project, so it is the real-time year of your build. This will be stored in a custom $(CopyrightYearCurrent) property.
  2. It will look for a $(CopyrightYearSince) property - that is a custom property that package authors might want to include, but it is completely optional.
  3. Evaluates a temporary $(_CopyrightYear) property that looks like this:
  • $(CopyrightYearSince)-$(CopyrightYearCurrent) if both properties are present
  • $(CopyrightYearCurrent) if $(CopyrightYearSince) was not set. $(CopyrightYearCurrent) is automatically evaluated, but package authors could specify it by hand and override the auto-generated value.
  1. Combines the other copyright metadata into a single copyright notice expression, that takes the following form:
    Copyright © $(Company) $(_CopyrightYear)

Examples

Authors only

Property Value
$(Authors) MyGreatCompany
$(CopyrightYearCurrent) 2026

Result

Property Purpose
$(Authors) MyGreatCompany
$(Company) MyGreatCompany
$(AssemblyCompany) MyGreatCompany
$(AssemblyCopyright) Copyright © MyGreatCompany 2026

Authors and year since

Property Value
$(Authors) MyGreatCompany
$(CopyrightYearSince) 2010
$(CopyrightYearCurrent) 2026

Result

Property Purpose
$(Authors) MyGreatCompany
$(Company) MyGreatCompany
$(AssemblyCompany) MyGreatCompany
$(AssemblyCopyright) Copyright © MyGreatCompany 2010-2026

Authors, company and year since

Property Value
$(Authors) MyGreatCompany
$(Company) MyGreatCompany inc.
$(CopyrightYearSince) 2010
$(CopyrightYearCurrent) 2026

Result

Property Purpose
$(Authors) MyGreatCompany
$(Company) MyGreatCompany inc.
$(AssemblyCompany) MyGreatCompany inc.
$(AssemblyCopyright) Copyright © MyGreatCompany inc. 2010-2026
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.35 0 9/15/2026
0.8.33 0 9/15/2026