CsWinRT
CsWinRT copied to clipboard
System.NotSupportedException when PublishAot is set to true
Describe the bug
The below exception occurred in TypeNameSupport.ResolveGenericType when PublishAot is set to true but not running under NativeAOT.
System.NotSupportedException: 'Cannot provide generic type from 'Windows.Foundation.IAsyncOperation`1'.'
To Reproduce
- Checkout the
aotbranch of https://github.com/hez2010/WinRTServer/tree/aot - Run the project directly in VS
Expected behavior No exception.
Version Info Package built from staging/AOT branch.
Additional context
RuntimeFeature.IsDynamicCodeCompiled will be set to true if PublishAot is set to true in csproj, regardless of whether the executable is published with NativeAOT or not.
I assume this is a first chance exception that is caught that you are seeing and that things still work or does it also crash?
You are right. It's a first chance exception. It doesn't crash.
Yea that is known, I will keep this open to track this until I decide if I want to leave it as is or put in some logic to handle that which in theory isn't really needed as we got type information later on which we use.
Yea that is known, I will keep this open to track this until I decide if I want to leave it as is or put in some logic to handle that which in theory isn't really needed as we got type information later on which we use.
I've seen this happen with a few methods as well