- Open the software and click the "Open Second Window" button.
- Stop debugging to simulate a crash (this same issue also happens if the app crashes).
- Open the software again and you will get the exception.
To fix this in while developing (in the IDE, this can't be done at runtime to my knowledge):
-
Remove the following from the Platforms/MacCatalyst/Info.plist file
<key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string> <key>UISceneDelegateClassName</key> <string>SceneDelegate</string> </dict> </array> </dict> </dict>
-
Clean and Rebuild the software and debug it (a window probably won't open)
-
Stop debugging
-
Debug it again.
-
Stop debugging.
-
Add those lines back to the Info.plist file.
-
Clean and Rebuild
-
Debug again (the software should open again)