Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 4603 [details]
Sample settings plist with four boolean-valued prefs
As discussed on the Xamarin forums. If you have a Settings.bundle/Root.plist which has Integer or Boolean preferences, the build fails with the following exception:
ERROR [2013-08-11 00:50:36Z]: System.InvalidCastException: Cannot cast from source type to destination type.
at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
at MonoDevelop.MacDev.PlistEditor.PDictionary.Get[PString] (System.String key) [0x00022] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/PlistEditor/PListObject.cs:591
at MonoDevelop.IPhone.IPhoneBuildExtension.UpdateDebugSettingsPlist (IProgressMonitor monitor, MonoDevelop.IPhone.IPhoneProjectConfiguration conf, FilePath target) [0x0013e] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs:2491
at MonoDevelop.IPhone.IPhoneBuildExtension.Build (IProgressMonitor monitor, MonoDevelop.Projects.SolutionEntityItem item, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00c8a] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneBuildExtension.cs:370
at MonoDevelop.Projects.ProjectServiceExtension.Build (IProgressMonitor monitor, IBuildTarget item, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00015] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:154
at MonoDevelop.Projects.ProjectServiceExtension.RunTarget (IProgressMonitor monitor, IBuildTarget item, System.String target, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00016] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:114
Looking over the documentation for PreferenceSpecifiers (Root.plist schema), all of the defined Dictionary children of the PreferenceSpecifiers array have a 'Type' key of type string, none of them allow boolean or integer values for the 'Type' key.
If you want a toggle button, the 'Type' key should contain "PSToggleSwitchSpecifier"
I mean, I can fix the code to be more fault tolerant when reading that file but are you sure it's valid?
Okay, thanks. Turns out that I was confused by UI of the plist editor. Entirely my mistake. Sorry about that.
Well, this is still a valid bug :-)
Turns out that fixing this is really just a 1-line patch to our plist Dictionary implementation.
That said, this is now fixed in git master to not throw this exception anymore and handles the error condition much more gracefully.