Fix invalid cast exception with stream APIs and make code fixer emit diagnostics as warnings#1654
Conversation
…by the SDK projection
…rning level to control that
Co-authored-by: Dongle <29563098+dongle-the-gadget@users.noreply.github.com>
Co-authored-by: Dongle <29563098+dongle-the-gadget@users.noreply.github.com>
|
Thank you for trying to fix #1634. Unfortunately, I still see the same issue with this patch. Interestingly, if I copy StreamTaskAdaptersImplementation.cs to my application and make sure its Init() method has been called, it works. |
Did you just use the updated |
|
Ok, I thought the updated code was in WinRT.Runtime.dll and I only used an updated cswinrt nuget package. So I guess everything will be fine once an updated Windows SDK nuget package is available. |
CsWinRTAotWarningLevelproperty to control whether the warnings from the code fixer are emitted as warnings or info. By default, for scenarios involving non built-in types, they will be emitted as warnings and built-in types will be emitted as info. The property can be used to control that behavior.AsyncInfo.Run, but given we disable the lookup table generation on the Windows SDK projection, they are not automatically made AOT safe. Due to that, adding a manual implementation of what would get generated and only initializing it from the stream scenarios so that other scenarios can just trim it if the stream extension APIs are not used.Fixes #1634
Fixes #1649