Closed Sergio0694 closed 1 year ago
cc. @AaronRobinsonMSFT @jkoritzinsky as this might potentially be related to ComWrappers
.
cc. @MichalStrehovsky as this is NAOT-related, maybe the output there gives you any ideas?
This was the same issue (just with a slightly different observable result) as https://github.com/dotnet/runtime/issues/84908. Fixed by https://github.com/dotnet/runtime/pull/85087 🎉
Describe the bug
Opening this as part of an investigation into a NativeAOT crash I noticed in ComputeSharp, which we've been trying to narrow down (as a collaborative effort over in the C# Discord). While trying to put together a minimal repro, I couldn't quite reproduce the same crash (which seems to be something going wrong in
ComWrappers
on NAOT), but I still noticed what seems to be incorrect behavior on NAOT, so here's a separate issue to track that. Not entirely sure whether this is more an issue withComWrappers
or CsWinRT, so opening it here for now. Will try to create aComWrappers
-only repro too later on to see if it also repros with just that.To Reproduce
new7-windows10.0.22621
as TFMCode (click to expand):
```csharp using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WinRT.Interop; using WinRT; unsafe { DummyUnknown unknown = new(); for (int i = 0; i < 10; i++) { var value2 = MarshalInspectable
<PublishAot>true</PublishAot>
to the .csproj fileExpected behavior
This is what you also get with a normal F5 deploy.
Actual behavior
...?!?!?? wha-