Skip to content

Source generator to expose assembly attributes as string constants.

License

Notifications You must be signed in to change notification settings

loresoft/AssemblyMetadata.Generators

Repository files navigation

AssemblyMetadata.Generators

Source generator to expose assembly attributes as string constants.

Build status

NuGet Version

Coverage Status

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

Source generator to expose assembly attributes as string constants.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Languages