VDimensions.MSBuild.Sdk.Copyright 0.7.30

Suggested Alternatives

VDimensions.MSBuild.Sdk.Copyrighting

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package VDimensions.MSBuild.Sdk.Copyright --version 0.7.30
                    
NuGet\Install-Package VDimensions.MSBuild.Sdk.Copyright -Version 0.7.30
                    
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.Copyright" Version="0.7.30">
  <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.Copyright" Version="0.7.30" />
                    
Directory.Packages.props
<PackageReference Include="VDimensions.MSBuild.Sdk.Copyright">
  <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.Copyright --version 0.7.30
                    
#r "nuget: VDimensions.MSBuild.Sdk.Copyright, 0.7.30"
                    
#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.Copyright@0.7.30
                    
#: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.Copyright&version=0.7.30
                    
Install as a Cake Addin
#tool nuget:?package=VDimensions.MSBuild.Sdk.Copyright&version=0.7.30
                    
Install as a Cake Tool

VDimensions.MSBuild.Sdk.Copyright

Ensures that the assembly copyright information that is built into the output dll files is aligned with the copyright information of the package and the project in general.

The Problem

MSBuild uses separate properties to express this 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, and most people often overlook them. There is also no sensible fallback if you for example define $(Company), and expect that $(AssemblyCompany) assumes the same value, to MSBuild those are separate properties. So, not only those are not easily defineable, but also developers have to know what is the purpose of each properties and to provide all of them in the end.

The Solution

This package adds MSBuild targets 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 $(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. Remember, that $(CopyrightYearCurrent) is automatically evaluated, but package authors could specify it by hand to prevent the auto-generation.
  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 (at the time of writing this document)

Result

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

Authors and year since

Property Value
$(Authors) MyGreatCompany
$(CopyrightYearSince) 2010 (at the time of writing this document)
$(CopyrightYearCurrent) 2026 (at the time of writing this document)

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 (at the time of writing this document)
$(CopyrightYearCurrent) 2026 (at the time of writing this document)

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
Loading failed