Preferences crash when debugging in Windows #18385
Labels
area-essentials
Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info
platform/windows 🪟
s/triaged
Issue has been reviewed
s/try-latest-version
Please try to reproduce the potential issue on the latest public version
t/bug
Something isn't working
Description
When I attach a breakpoint on a line that will be reading from the Preferences and debug a windows instance of the app, the application throws an error:
System.TypeInitializationException: 'The type initializer for 'WinRT.ActivationFactory`1' threw an exception.'
Inner Exception:
COMException: ClassFactory cannot supply requested class
If I don't have a breakpoint on the line, it works successfully
Steps to Reproduce
MauiApp3 - Microsoft Visual Studio Preview 2023-10-26 11-42-08.zip
Link to public reproduction project repository
https://github.com/AndersenBell/MAUI-Preferenes-Win-Bug
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
if you don't debug, then it works, or if you call
Preferences.ContainsKey
firstRelevant log output
The text was updated successfully, but these errors were encountered: