Skip to content

Commit

Permalink
Merge pull request #28 from KoalaBear84/patch-1
Browse files Browse the repository at this point in the history
Add example to extract Assembly Metadata
  • Loading branch information
MarkPflug authored Jul 20, 2021
2 parents 7d4dc8c + 24b4471 commit 61cfbb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ If there are additional commands and output that are needed to be included in th
</ItemGroup>
```

### Extract Assembly Metadata

```csharp
using System.Reflection;

string gitHash = Assembly
.GetEntryAssembly()
.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(attr => attr.Key == "GitHash")?.Value;
```

## Version History
_2.0.2_
- Fix issues introduced by changes from the Microsoft.NET.Sdk.
Expand Down

0 comments on commit 61cfbb3

Please sign in to comment.