ThisAssembly.Constants 1.0.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package ThisAssembly.Constants --version 1.0.2
                    
NuGet\Install-Package ThisAssembly.Constants -Version 1.0.2
                    
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="ThisAssembly.Constants" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ThisAssembly.Constants" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="ThisAssembly.Constants" />
                    
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 ThisAssembly.Constants --version 1.0.2
                    
#r "nuget: ThisAssembly.Constants, 1.0.2"
                    
#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 ThisAssembly.Constants@1.0.2
                    
#: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=ThisAssembly.Constants&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=ThisAssembly.Constants&version=1.0.2
                    
Install as a Cake Tool

** C# 9.0 ONLY **
This package generates a static `ThisAssembly.Constants` class with public
constants for each Constant MSBuild item in the project.

For example:

 <ItemGroup>
 <Constant Include="Foo.Bar" Value="Baz" />
 </ItemGroup>

Results in a corresponding `ThisAssembly.Constants.Foo.Bar` constant with the value `Baz`:

Generated code:
C#:

 partial class ThisAssembly
 {
     public static partial class Constants
     {
         public static partial class Foo
         {
             public const string Bar = "Baz";
         }
     }
 }

   

Built from https://github.com/kzu/ThisAssembly/tree/9fb55b8d0

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on ThisAssembly.Constants:

Package Downloads
GitInfo

Access commit information from MSBuild and C#/F#/VB code, and infer SemVer from branch, tag or version file in Git repository.

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.

ThisAssembly.Project

This package generates a static `ThisAssembly.Project` class with public constants exposing project properties that have been opted into this mechanism by adding them as `ProjectProperty` MSBuild items in project file, such as: <PropertyGroup> <Foo>Bar</Foo> </PropertyGroup> <ItemGroup> <ProjectProperty Include="Foo" /> </ItemGroup> A corresponding `ThisAssembly.Project.Foo` constant with the value `Bar` is provided. Generated code: C#: partial class ThisAssembly { public static partial class Project { public const string Foo = "Bar"; } }

ThisAssembly

Meta-package that includes all ThisAssembly.* packages.

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"; } }

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on ThisAssembly.Constants:

Repository Stars
CollapseLauncher/Collapse
An Advanced Launcher for miHoYo/HoYoverse Games
devlooped/ThisAssembly
Expose project and assembly level information as constants in the ThisAssembly class using source generators powered by Roslyn.
Version Downloads Last Updated
2.1.2 132,014 10/17/2025
2.1.1 568 10/16/2025
2.1.0 922 10/16/2025
2.1.0-rc.1 143 10/16/2025
2.1.0-rc 426 10/16/2025
2.1.0-beta 419 10/16/2025
2.0.14 34,844 4/30/2025
2.0.13 1,477 4/24/2025
2.0.12 11,071 2/18/2025
2.0.11 6,769 2/8/2025
2.0.10 14,833 11/26/2024
2.0.9 1,107 11/23/2024
2.0.8 13,261 11/8/2024
2.0.7 612 11/8/2024
2.0.6 739,045 11/1/2024
2.0.5 3,256 10/9/2024
2.0.4 566 10/8/2024
2.0.3 2,797 9/30/2024
2.0.2 716 9/30/2024
1.0.2 1,448 12/10/2020
Loading failed