-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taking a WeakReference to a C# object that inherits a native WinRT object crashes the app. #1025
Comments
Took a quick look and looks like it is failing to find the managed object:
|
Another stack
|
@manodasanW This appears to be a .NET bug. @jkoritzinsky will be looking into a fix. We chatted offline and I believe we understand the problem—it is limited to aggregation scenarios where the native base type implements |
@jkoritzinsky is there a .NET build I can use to verify this is fixed? |
There's not a build available of the whole sdk, but this link should provide you with a .NET 7 nightly runtime build with the fix: https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.0-alpha.1.21558.2/dotnet-runtime-7.0.0-alpha.1.21558.2-win-x64.exe |
Describe the bug
WeakReferences to managed objects inheriting native objects causes InvalidCastExceptions and/or access violations.
To Reproduce
Expected behavior
No crash/exception.
Version Info
CsWinRT 1.3.5
The text was updated successfully, but these errors were encountered: