ThisAssembly.Constants 1.1.1-beta

This package generates a static ThisAssembly.Constants class with public constants for @(Constant) MSBuild items in the project.

  <ItemGroup>
    <Constant Include="Foo.Bar" Value="Baz" Comment="Yay!" />
    <Constant Include="Foo.Hello" Value="World" Comment="Comments make everything better 😍" />
  </ItemGroup>

In addition to arbitrary constants via <Constant ...>, it's quite useful (in particular in test projects) to generate constants for files in the project, so there's also a shorthand for those:

  <ItemGroup>
    <FileConstant Include="@(Content)" />
  </ItemGroup>

Which results in:

Sponsors

Clarius Org Christian Findlay C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. SandRock Eric C Andy Gocke

Sponsor this project  

Learn more about GitHub Sponsors

Showing the top 20 packages that depend on ThisAssembly.Constants.

Packages Downloads
ThisAssembly
Meta-package that includes all ThisAssembly.* packages.
4
ThisAssembly.Metadata
This package generates a static `ThisAssembly.Metadata` class with public constants exposing each `[System.Reflection.AssemblyMetadata(..)]` defined for the project, such as when using .NET 5.0+ support for `AssemblyMetadata` MSBuild items. So for an attribute like: [assembly: System.Reflection.AssemblyMetadataAttribute("Foo", "Bar")] A corresponding `ThisAssembly.Metadata.Foo` constant with the value `Bar` is provided. The metadata attribute can alternatively be declared using MSBuild in the project (for .NET 5.0+ projects): <ItemGroup> <AssemblyMetadata Include="Foo" Value="Bar" /> </ItemGroup> Generated code: C#: partial class ThisAssembly { public static partial class Metadata { public const string Foo = "Bar"; } } > This project uses SponsorLink to attribute sponsor status (direct, indirect or implicit). For IDE usage, sponsor status is required. > IDE-only warnings will be emitted after a grace period otherwise. Learn more at https://github.com/devlooped#sponsorlink.
4
ThisAssembly.Git
This package generates a static `ThisAssembly.Git` class with public constants for the following properties provided by Microsoft.SourceLink (git-based) packages: * Commit * Sha (first 9 chars from Commit) * Root (normalized to forward slashes) * Url (if PublishRepositoryUrl=true) It also provides the Branch property, calculated from supported CI environment variables (GitHub Actions, Azure DevOps, AppVeyor, TeamCity, Travis CI, Circle CI, GitLab CI, Buddy, and Jenkins).
4
ThisAssembly.Git
This package generates a static `ThisAssembly.Git` class with public constants for the following properties provided by Microsoft.SourceLink (git-based) packages: * Commit * Sha (first 9 chars from Commit) * Root (normalized to forward slashes) * Url (if PublishRepositoryUrl=true) It also provides the Branch property, calculated from supported CI environment variables (GitHub Actions, Azure DevOps, AppVeyor, TeamCity, Travis CI, Circle CI, GitLab CI, Buddy, and Jenkins). > This project uses SponsorLink to attribute sponsor status (direct, indirect or implicit). For IDE usage, sponsor status is required. > IDE-only warnings will be emitted after a grace period otherwise. Learn more at https://github.com/devlooped#sponsorlink.
4
ThisAssembly.AssemblyInfo
This package generates a static `ThisAssembly.Info` class with public constants exposing the following attribute values generated by default for SDK style projects: * AssemblyConfigurationAttribute * AssemblyCompanyAttribute * AssemblyTitleAttribute * AssemblyProductAttribute * AssemblyVersionAttribute * AssemblyInformationalVersionAttribute * AssemblyFileVersionAttribute If your project includes these attributes by other means, they will still be emitted properly on the `ThisAssembly.Info` class.
4
ThisAssembly.AssemblyInfo
This package generates a static `ThisAssembly.Info` class with public constants exposing the following attribute values generated by default for SDK style projects: * AssemblyConfigurationAttribute * AssemblyCompanyAttribute * AssemblyTitleAttribute * AssemblyProductAttribute * AssemblyVersionAttribute * AssemblyInformationalVersionAttribute * AssemblyFileVersionAttribute If your project includes these attributes by other means, they will still be emitted properly on the `ThisAssembly.Info` class. > This project uses SponsorLink to attribute sponsor status (direct, indirect or implicit). For IDE usage, sponsor status is required. > IDE-only warnings will be emitted after a grace period otherwise. Learn more at https://github.com/devlooped#sponsorlink.
4

.NET Standard 2.0

Version Downloads Last updated
2.1.2 2 06/16/2026
2.1.1 3 06/16/2026
2.1.0 3 06/16/2026
2.1.0-rc.1 3 06/16/2026
2.1.0-rc 3 06/16/2026
2.1.0-beta 3 06/16/2026
2.0.14 3 06/16/2026
2.0.13 3 06/16/2026
2.0.12 3 06/16/2026
2.0.11 3 06/16/2026
2.0.10 3 06/16/2026
2.0.9 3 06/16/2026
2.0.8 3 06/16/2026
2.0.7 3 06/16/2026
2.0.6 3 06/16/2026
2.0.5 3 06/16/2026
2.0.4 3 06/16/2026
2.0.3 3 06/16/2026
2.0.2 3 06/16/2026
1.4.3 3 06/16/2026
1.4.2 3 06/16/2026
1.4.1 3 06/16/2026
1.4.0 3 06/16/2026
1.1.3 3 06/16/2026
1.1.2 3 06/16/2026
1.1.1 3 06/16/2026
1.1.1-beta 3 06/16/2026
1.1.0 3 06/16/2026
1.0.10 4 06/16/2026
1.0.9 3 06/16/2026
1.0.8 3 06/16/2026
1.0.7 3 06/16/2026
1.0.6 3 06/16/2026
1.0.5 3 06/16/2026
1.0.4 3 06/16/2026
1.0.3 4 06/16/2026
1.0.2 4 06/16/2026
1.0.1 4 06/16/2026
1.0.0 4 06/16/2026
1.0.0-rc.1 4 06/16/2026
1.0.0-rc 4 06/16/2026