Skip to content

Commit 2934514

Browse files
authored
Add support for @(AssemblyMetadata) items that turn into assembly attributes
Given that `AssemblyMetadataAttribute` is such a common assembly-level attribute, this adds support for specifying it directly via simple items, such as: ``` <AssemblyMetadata Include="Foo" Value="Bar" /> <AssemblyMetadata Include="Bar" Value="Baz" /> ``` This also avoids having to learn the `_Parameter1` and `_Parameter2` syntax in `AssemblyAttribute` elements, and is more similar to the way other higher-level properties like `AssemblyTitle` or `Product` are also turned into assembly attributes. Partially fixes #3166
1 parent 095fe9b commit 2934514

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateAssemblyInfo.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ Copyright (c) .NET Foundation. All rights reserved.
9494
<AssemblyAttribute Include="System.Resources.NeutralResourcesLanguageAttribute" Condition="'$(NeutralLanguage)' != '' and '$(GenerateNeutralResourcesLanguageAttribute)' == 'true'">
9595
<_Parameter1>$(NeutralLanguage)</_Parameter1>
9696
</AssemblyAttribute>
97+
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata" Condition="%(AssemblyMetadata.Identity) != ''">
98+
<_Parameter1>%(AssemblyMetadata.Identity)</_Parameter1>
99+
<_Parameter2>%(AssemblyMetadata.Value)</_Parameter2>
100+
</AssemblyAttribute>
97101
</ItemGroup>
98102
</Target>
99103

0 commit comments

Comments
 (0)