I have a cross-platform desktop app where I want to display a MapKitViewControlMBS map for macOS users, but this control will be invisible for Windows and Linux.
All the MapKitViewControlMBS code is surrounded with #If TargetMacOS then…, yet I get a PlatformNotSupportedException ‘Mac 64-bit only.’ on Windows. It compiles and runs, but when I Show the window with the map I get the error and have to jump over it. The app window seems to run OK after this, but slows down my debugging, and I plan to put this map in other windows.
I can surround the showing of the window with #Pragma BreakOnExceptions False to stop the error, but this seems like a sledgehammer on a walnut.
Is there a better way to include this control on the window, but not get the debug error?