CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Incorrect trim annotations in ObjectReferenceWithContext<T>.GetCurrentContext()

Open Sergio0694 opened this issue 2 years ago • 0 comments

Describe the bug

The ObjectReferenceWithContext<T>.GetCurrentContext() has incorrect trim annotations and is not actually trim safe (not preserving public fields that GetIID requires), but is not producing a warning due to a bug in the trim analyzer.

See: https://github.com/dotnet/runtime/issues/95258.

https://github.com/microsoft/CsWinRT/blob/71169932920500310921b4c3fadba1e5a99c6138/src/WinRT.Runtime/ObjectReference.cs#L601

It would be even better if we could stop requiring GuidGenerator entirely here, actually.

Sergio0694 avatar Nov 27 '23 11:11 Sergio0694