[release/7.0] Make System.Transactions.Local trimmable on Windows (#75176) #75377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #75176 to release/7.0
Customer Impact
This is fixing the trimmability of the new distributed transaction support in .NET 7.
System.Transactions.Local
assembly is not being trimmed, even if the app doesn't use Transactions.Testing
Manually tested that System.Transactions.Local gets trimmed away when trimming an app on Windows that doesn't use System.Transactions.
No real logic has changed. All automated tests pass.
Risk
Low. This is a feature ported from .NET Framework to .NET 7. This code was never supported on .NET Core previously, so it won't break anyone.
Remove
IsTrimmable=false
from the project, so this assembly is still trimmed withpartial
trimming on Windows.Add a "LibraryBuild" ILLink warning, so when the distributed transaction code is not trimmed, the app developer gets a warning that it is not guaranteed to work.
Fix #75031