Bug 24466 - Instancing NSOpenPanel.OpenPanel fails with sandbox entitlements
Summary: Instancing NSOpenPanel.OpenPanel fails with sandbox entitlements
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 1.10.0
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2014-11-12 11:09 UTC by Chris Hamons
Modified: 2014-11-14 12:00 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Repro (22.29 KB, application/zip)
2014-11-12 11:10 UTC, Chris Hamons
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Chris Hamons 2014-11-12 11:09:08 UTC
See attached project. Run from command line for exception.

Unhandled Exception:
System.InvalidCastException: Cannot cast from source type to destination type.
  at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
  at MonoMac.ObjCRuntime.Runtime.ConstructNSObject[NSOpenPanel] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x00000] in <filename unknown>:0 
  at MonoMac.ObjCRuntime.Runtime.GetNSObject[NSOpenPanel] (IntPtr ptr) [0x00000] in <filename unknown>:0 
  at MonoMac.AppKit.NSOpenPanel.get_OpenPanel () [0x00000] in <filename unknown>:0 
  at Sandbox2.AppDelegate.HandleActivated (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at MonoMac.AppKit.ActionDispatcher.OnActivated (MonoMac.Foundation.NSObject sender) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) MonoMac.AppKit.NSApplication:NSApplicationMain (int,string[])
  at MonoMac.AppKit.NSApplication.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at Sandbox2.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Cannot cast from source type to destination type.
  at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
  at MonoMac.ObjCRuntime.Runtime.ConstructNSObject[NSOpenPanel] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x00000] in <filename unknown>:0 
  at MonoMac.ObjCRuntime.Runtime.GetNSObject[NSOpenPanel] (IntPtr ptr) [0x00000] in <filename unknown>:0 
  at MonoMac.AppKit.NSOpenPanel.get_OpenPanel () [0x00000] in <filename unknown>:0 
  at Sandbox2.AppDelegate.HandleActivated (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at MonoMac.AppKit.ActionDispatcher.OnActivated (MonoMac.Foundation.NSObject sender) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) MonoMac.AppKit.NSApplication:NSApplicationMain (int,string[])
  at MonoMac.AppKit.NSApplication.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at Sandbox2.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
Comment 1 Chris Hamons 2014-11-12 11:10:19 UTC
Created attachment 8701 [details]
Repro
Comment 2 Chris Hamons 2014-11-14 12:00:41 UTC
Fixed in master / d5b387d4099224be8897e8392def2be58c15d68a