Bug 1549 - Cannot add keys manually
Summary: Cannot add keys manually
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2011-10-18 07:40 UTC by Alan McGovern
Modified: 2011-10-19 06:43 UTC (History)
1 user (show)

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

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 Alan McGovern 2011-10-18 07:40:48 UTC
If you try to add a new key using the advanced editor, it chooses 'string' type by default. Unfortunately this breaks things if this is a key which other parts of the code use, such as the Icon Files key. If you right click and add a new key, and then choose 'Icon Files' from the dropdown list, you get this exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_object_castclass (object,intptr)
  at MonoDevelop.MacDev.PlistEditor.PDictionary.Get[PArray] (System.String key) [0x0001c] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:368 
  at MonoDevelop.IPhone.PlistEditor.PlistIconFileManager.Update () [0x00012] in /Users/alanmcgovern/Projects/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/PlistEditor/PlistIconFileManager.cs:83 
  at MonoDevelop.IPhone.PlistEditor.PlistIconFileManager.DictionaryChanged (System.Object sender, System.EventArgs e) [0x00000] in /Users/alanmcgovern/Projects/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/PlistEditor/PlistIconFileManager.cs:65 
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at MonoDevelop.MacDev.PlistEditor.PObject.OnChanged (System.EventArgs e) [0x00019] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:154 
  at MonoDevelop.MacDev.PlistEditor.PDictionary.ChangeKey (MonoDevelop.MacDev.PlistEditor.PObject obj, System.String newKey) [0x00053] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:350 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget+<CustomPropertiesWidget>c__AnonStorey4.<>m__0 (System.Object o, Gtk.EditedArgs args) [0x000cd] in /Users/alanmcgovern/Projects/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:279 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
Comment 1 Alan McGovern 2011-10-19 06:43:56 UTC
Fixed in git. We now always ensure that we have the correct value type when a key is renamed.