CsWinRT
CsWinRT copied to clipboard
Incorrect trim annotations in ObjectReferenceWithContext<T>.GetCurrentContext()
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.