https://github.com/loresoft/assemblymetadata.generators
Source generator to expose assembly attributes as string constants.
https://github.com/loresoft/assemblymetadata.generators
Last synced: 9 months ago
JSON representation
Source generator to expose assembly attributes as string constants.
- Host: GitHub
- URL: https://github.com/loresoft/assemblymetadata.generators
- Owner: loresoft
- License: mit
- Created: 2023-08-10T00:01:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-06T08:03:21.000Z (9 months ago)
- Last Synced: 2025-05-06T09:23:58.226Z (9 months ago)
- Language: C#
- Homepage:
- Size: 225 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# AssemblyMetadata.Generators
Source generator to expose assembly attributes as string constants.
[](https://github.com/loresoft/AssemblyMetadata.Generators/actions)
[](https://www.nuget.org/packages/AssemblyMetadata.Generators/)
[](https://coveralls.io/github/loresoft/AssemblyMetadata.Generators?branch=main)
### 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
```c#
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.
```xml
$(RootNamespace)
```