Skip to content

Commit

Permalink
Remove AssemblyMetadata(".NETFrameworkAssembly", "") attributes (#8…
Browse files Browse the repository at this point in the history
…9490)

* Remove `AssemblyMetadata(".NETFrameworkAssembly", "")` attributes

This is likely a .NET Native leftover that is currently (ironically) breaking .NET Native. This attribute indicates to the .NET Native compiler that the assembly can be trimmed.

We're currently setting this on assemblies that no longer carry RD.XML to make this safe. Without this attribute, the assembly will be treated like any other and not trimmed.

Fixes #44697.

* Delete mention of the attribute in docs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
MichalStrehovsky and jkotas committed Jul 27, 2023
1 parent 76020ae commit 1138b24
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion docs/design/tools/illink/trimmed-assemblies.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ If there is a use case for specifying trimmable assemblies on the command-line,
We will use `AssemblyMetadataAttribute` to specify `IsTrimmable` on an assembly, instead of introducing a new attribute. The existing attribute seems well-suited for this use case, as it is already similarly used to control servicing for framework assemblies, for example via:

```csharp
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
```
Expand Down
6 changes: 0 additions & 6 deletions eng/versioning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
<Description Condition="'$(Description)' == ''">$(AssemblyName)</Description>
</PropertyGroup>

<!-- Assembly metadata indicating that an assembly is a framework (as opposed to user) assembly:
Test projects need to not have this because of the way "IsFrameworkAssembly" APIs work to check this. -->
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
<_Parameter1>.NETFrameworkAssembly</_Parameter1>
<_Parameter2></_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
<_Parameter1>Serviceable</_Parameter1>
<_Parameter2>True</_Parameter2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,6 @@
</argument>
</attribute>
</type>
<type fullname="System.Reflection.AssemblyMetadataAttribute">
<attribute internal="RemoveAttributeInstances">
<argument type="System.Object">
<argument>.NETFrameworkAssembly</argument>
</argument>
</attribute>
</type>
<type fullname="System.Reflection.AssemblyMetadataAttribute">
<attribute internal="RemoveAttributeInstances">
<argument type="System.Object">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32)]

[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("IsTrimmable", "True")]

[assembly: NeutralResourcesLanguage("en-US")]

0 comments on commit 1138b24

Please sign in to comment.