Skip to content

Commit

Permalink
Improve wording of the assembly metadata support
Browse files Browse the repository at this point in the history
We don't actually retrieve hand-coded attbutes in code, only MSBuild items.
  • Loading branch information
kzu committed Oct 9, 2024
1 parent cbbf586 commit cb79b24
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/ThisAssembly.Metadata/readme.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
<!-- include https://github.com/devlooped/.github/raw/main/sponsorlinkr.md -->
<!-- #metadata -->
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
Expand All @@ -22,6 +13,11 @@ The metadata attribute can alternatively be declared using MSBuild syntax in the
</ItemGroup>
```

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)

<!-- #metadata -->
<!-- include ../visibility.md -->
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
Expand Down

0 comments on commit cb79b24

Please sign in to comment.