SlusserLabs.AssemblyInfo
1.0.0-ci.6
See the version list below for details.
dotnet add package SlusserLabs.AssemblyInfo --version 1.0.0-ci.6
NuGet\Install-Package SlusserLabs.AssemblyInfo -Version 1.0.0-ci.6
<PackageReference Include="SlusserLabs.AssemblyInfo" Version="1.0.0-ci.6" />
<PackageVersion Include="SlusserLabs.AssemblyInfo" Version="1.0.0-ci.6" />
<PackageReference Include="SlusserLabs.AssemblyInfo" />
paket add SlusserLabs.AssemblyInfo --version 1.0.0-ci.6
#r "nuget: SlusserLabs.AssemblyInfo, 1.0.0-ci.6"
#:package SlusserLabs.AssemblyInfo@1.0.0-ci.6
#addin nuget:?package=SlusserLabs.AssemblyInfo&version=1.0.0-ci.6&prerelease
#tool nuget:?package=SlusserLabs.AssemblyInfo&version=1.0.0-ci.6&prerelease
AssemblyInfo
AssemblyInfo is a source generator that exposes assembly attributes and custom assembly metadata through generated constants. The values are captured at compile time and require no runtime reflection, making it suitable for AOT.
This project exists to provide access to assembly information without the need for reflection. If your build target supports reflection, you can still use this project but it would be for its convenience only.
Installation
Add the package to the project whose assembly information you want to expose:
dotnet add package SlusserLabs.AssemblyInfo
Usage
Mark a partial class or record as the destination for generated metadata using the GenerateAssemblyInfo attribute:
using SlusserLabs.AssemblyInfo;
[GenerateAssemblyInfo]
public static partial class AssemblyInfo;
The following .csproj project properties are supported as outlined in MSBuild documentation:
<PropertyGroup>
<Company></Company>
<Configuration></Configuration>
<Copyright></Copyright>
<Description></Description>
<FileVersion></FileVersion>
<InformationalVersion></InformationalVersion>
<Product></Product>
<AssemblyTitle></AssemblyTitle>
<AssemblyVersion></AssemblyVersion>
</PropertyGroup>
The result is a generated class with the following public const fields:
public static partial class AssemblyInfo
{
public const string Configuration;
public const string Company;
public const string AssemblyTitle;
public const string Description;
public const string Product;
public const string Copyright;
public const string AssemblyVersion;
public const string InformationalVersion;
public const string FileVersion;
}
That's it!
AssemblyMetadata
Custom AssemblyMetadataAttribute values are also supported and makes it easy to embed arbitrary strings. For example, this project configuration:
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>BuildDate</_Parameter1>
<_Parameter2>2026-08-17</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
generates a BuildDate constant.
I would recommend always using key names that are also valid C# identifiers because they will be generated as the name of a const, however, the source generator will attempt to make them valid C# identifiers by replacing invalid characters if they are not otherwise. The generator reports an error if a converted name conflicts with another metadata key or a standard generated constant.
Advanced Options
The GenerateAssemblyInfo attribute accepts an optional GenerateAssemblyInfoOptions flags enum if you want want more control over which assembly metadata you want included. For example, if you wanted to put assembly attributes in one class and metadata in another to avoid naming collisions, you might do that like this (my usual preference):
using SlusserLabs.AssemblyInfo;
// Contains only title, product, version, etc...
[GenerateAssemblyInfo(GenerateAssemblyInfoOptions.AllAssemblyAttributes)]
public static partial class AssemblyInfo
{
// Contains only metadata key-value pairs
[GenerateAssemblyInfo(GenerateAssemblyInfoOptions.AssemblyMetadata)]
public static partial class Metadata;
}
AI Disclosure
This project was built with the help of Codex 5.6 Sol for code generation. As with any tool I use for coding, I am fully responsible for the end result and only put forward this project with full confidence I have reviewed every line and it meets my expectations wether that line of code was fully AI generated, AI assisted, or entirely from my own Muppet fingers on the keyboard.
Acknowledgements
This project is inspired by ThisAssembly. I wholeheartedly recommend that project if it is more to your liking; I just wanted slightly different ergonomics.
| Product | Versions 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. |
-
.NETStandard 2.0
- No dependencies.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-ci.21 | 2 | 8/22/2026 |
| 1.0.0-ci.18 | 2 | 8/22/2026 |
| 1.0.0-ci.15 | 0 | 8/22/2026 |
| 1.0.0-ci.6 | 1 | 8/21/2026 |
| 1.0.0-ci.4 | 0 | 8/21/2026 |