rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.07k stars 579 forks source link

Follow up to trimming changes for 6.x #1470

Closed eerhardt closed 7 months ago

eerhardt commented 8 months ago

Proposed Changes

The allows the 6.x library to be used in trimmed and native AOT'd applications without any warnings.

Since the 6.x branch doesn't target net6.0+, it only targets netstandard2.0 and net462, the #if NET6_0_OR_GREATER checks don't do anything.

To resolve this issue, and copy the trimming attributes into this library following the recommendation at https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries/#approach-2-define-the-attributes-internally. This allows the library to apply the attributes without targeting net6.0+.

Also moving DebugUtil to the test project - porting #1009 from the main branch.

Contributes to #1410

Types of Changes

What types of changes does your code introduce to this project? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask on the mailing list. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

cc @lukebakken

eerhardt commented 7 months ago

Thanks again here, @lukebakken, for your help pushing this through. When this is released I'll be able to remove the last warning suppression from dotnet/eShop, which will make the 2 apps there 100% native AOT compatible.