Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make System.Transactions.Local trimmable on Windows #75176

Merged
merged 7 commits into from
Sep 9, 2022
Prev Previous commit
Next Next commit
Remove the DynamicDependencies attributes
This gives a better message to users that distributed transactions don't work with trimming.
  • Loading branch information
eerhardt committed Sep 8, 2022
commit c909e176ebc5b32c3d2abbdcc372c1a69a0b4392
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,6 @@ private static extern void DtcGetTransactionManagerExW(
[MarshalAs(UnmanagedType.Interface)] out ITransactionDispenser ppvObject);

[RequiresUnreferencedCode("Distributed transactions support may not be compatible with trimming. If your program creates a distributed transaction via System.Transactions, the correctness of the application cannot be guaranteed after trimming.")]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IConnectionPoint))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IConnectionPointContainer))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IEnumConnectionPoints))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IEnumConnections))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IPrepareInfo))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IResourceManager))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IResourceManagerFactory2))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IResourceManagerSink))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITmNodeName))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransaction))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionCloner))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionDispenser))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionEnlistmentAsync))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionExport))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionExportFactory))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionImport))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionImportWhereabouts))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionOptions))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionOutcomeEvents))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionPhase0EnlistmentAsync))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionPhase0Factory))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionPhase0NotifyAsync))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionReceiver))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionReceiverFactory))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionResourceAsync))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionTransmitter))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionTransmitterFactory))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionVoterBallotAsync2))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionVoterFactory2))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(ITransactionVoterNotifyAsync2))]
private static void DtcGetTransactionManager(string? nodeName, out ITransactionDispenser localDispenser) =>
DtcGetTransactionManagerExW(nodeName, null, Guids.IID_ITransactionDispenser_Guid, 0, null, out localDispenser);

Expand Down