AssemblyMetadata.Generators by LoreSoft
NuGet / site data
Details
Info
Name: AssemblyMetadata.Generators
Source generator to expose assembly attributes as string constants
Author: LoreSoft
NuGet: https://www.nuget.org/packages/AssemblyMetadata.Generators/
You can find more details at https://github.com/loresoft/AssemblyMetadata.Generators
Source: https://github.com/loresoft/AssemblyMetadata.Generators
Author
LoreSoft

Original Readme
AssemblyMetadata.Generators
Source generator to expose assembly attributes as string constants.
######### Usage
########## Add package
Add the nuget package project to your projects.
dotnet add package AssemblyMetadata.Generators
######### Generated
This source generator creates an internal partial class called ThisAssembly with all the assembly level attributes converted to string constants
internal static partial class ThisAssembly
{
public const string TargetFramework = ".NETCoreApp,Version=v7.0";
public const string Company = "LoreSoft";
public const string Configuration = "Debug";
public const string Copyright = "Copyright © 2023 LoreSoft";
public const string Description = "Source generator to expose assembly attributes as string constants";
public const string FileVersion = "1.0.0.0";
public const string InformationalVersion = "1.0.0";
public const string Product = "AssemblyMetadata.Generators.Tests";
public const string Title = "AssemblyMetadata.Generators.Tests";
public const string Version = "1.0.0.0";
public const string RepositoryUrl = "https://github.com/loresoft/AssemblyMetadata.Generators";
public const string NeutralResourcesLanguage = "en-US";
}
######### Namespace
Set the ThisAssemblyNamespace MSBuild property to set the namespace of the generated ThisAssembly class. Otherwise, it will be in the global namespace.
Put ThisAssembly in the projects root namespace.
<PropertyGroup>
<ThisAssemblyNamespace>$(RootNamespace)</ThisAssemblyNamespace>
</PropertyGroup>
About
Generating assembly metadata attributes at compile time.
How to use
Example (source csproj, source files)
- CSharp Project
- Program.cs
This is the CSharp Project that references AssemblyMetadata.Generators
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.2.0" OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
</Project>
This is the use of AssemblyMetadata.Generators in Program.cs
Console.WriteLine(ThisAssembly.Title);
Console.WriteLine(ThisAssembly.TargetFramework);
Generated Files
Those are taken from $(BaseIntermediateOutputPath)\GX
- AssemblyMetadata.g.cs
// <auto-generated />
/// <summary>
/// Assembly attributes exposed as public constants
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("AssemblyMetadata.Generators", "2.2.0+ec398d1ec2fd415d5475a08ad0fada879c510c97")]
internal static partial class ThisAssembly
{
public const string TargetFramework = ".NETCoreApp,Version=v10.0";
public const string Company = "DemoMeta";
public const string Configuration = "Debug";
public const string FileVersion = "1.0.0.0";
public const string InformationalVersion = "1.0.0+3eed64e7dd376ed8c6cf1f77efd5968cb88c898a";
public const string Product = "DemoMeta";
public const string Title = "DemoMeta";
public const string Version = "1.0.0.0";
public const string AssemblyName = "DemoMeta";
public const string DefineConstants = "TRACE";
public const string RootNamespace = "DemoMeta";
public const string PackageVersion = "1.0.0";
public const string PackageId = "DemoMeta";
}
Useful
Download Example (.NET C#)
Share AssemblyMetadata.Generators
https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyMetadata.Generators
Category "EnhancementProject" has the following generators:
1 AssemblyMetadata
2026-04-02
2 AssemblyMetadata.Generators
2026-05-15
3 AssemblyVersionInfo
2025-07-28
4 AutoInvoke.Generator
2024-03-03
5 AutoSpectre
2024-02-24
6 BuildInfo
2024-01-20
7 Credfeto.Version.Information.Generator
2024-11-05
8 Larcanum.GitInfo
2025-01-17
9 LinqGen.Generator
2024-03-04
10 Pekspro.BuildInformationGenerator
2024-07-19
11 PlantUmlClassDiagramGenerator
2024-02-20
12 RSCG_AMS
2023-04-16
13 RSCG_ExportDiagram
2024-08-01
14 RSCG_FunctionsWithDI
2023-04-16
15 RSCG_NameGenerator
2024-08-25
16 RSCG_TimeBombComment
2023-04-16
17 RSCG_Wait
2024-02-21
18 ShadowWriterProjectInfo
2025-07-27
19 ThisAssembly
2023-04-16
20 ThisAssembly.Constants
2024-07-18
21 ThisAssembly.Metadata
2024-07-20