From cb79b243710d4fac3330e23951e20f9d1d9e3e20 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 9 Oct 2024 14:05:39 -0300 Subject: [PATCH] Improve wording of the assembly metadata support We don't actually retrieve hand-coded attbutes in code, only MSBuild items. --- src/ThisAssembly.Metadata/readme.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/ThisAssembly.Metadata/readme.md b/src/ThisAssembly.Metadata/readme.md index 58336056..57db2de0 100644 --- a/src/ThisAssembly.Metadata/readme.md +++ b/src/ThisAssembly.Metadata/readme.md @@ -1,19 +1,10 @@ This package provides a static `ThisAssembly.Metadata` class with public -constants exposing each `[System.Reflection.AssemblyMetadata(..)]` defined for -the project. +constants exposing each `[System.Reflection.AssemblyMetadata(..)]` defined in +the project file as [supported by the .NET SDK](https://learn.microsoft.com/en-us/dotnet/standard/assembly/set-attributes-project-file#set-arbitrary-attributes). -![](https://raw.githubusercontent.com/devlooped/ThisAssembly/main/img/ThisAssembly.Metadata.png) - -For an attribute declared (i.e. in *AssemblyInfo.cs*) like: - -```csharp -[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 syntax in the project +The metadata attribute is declared using MSBuild syntax in the project (for .NET 5.0+ projects that have built-in support for `@(AssemblyMetadata)` items): ```xml @@ -22,6 +13,11 @@ The metadata attribute can alternatively be declared using MSBuild syntax in the ``` +And a corresponding `ThisAssembly.Metadata.Foo` constant with the value `Bar` is provided +for this example. + +![](https://raw.githubusercontent.com/devlooped/ThisAssembly/main/img/ThisAssembly.Metadata.png) +