Bug 12065 - Exception on remove project item
Summary: Exception on remove project item
Status: NEW
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 4.0.3
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2013-05-02 03:08 UTC by Fredrik Haglund
Modified: 2013-05-03 19:30 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 for Bug 12065 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Fredrik Haglund 2013-05-02 03:08:42 UTC
Steps

* Create ios project with story board
* Add RootViewControler in storyboard
* Save, switch back to Xamarin Studio
* Remove RootViewController.cs from project by right click in Solution Tree.
* Go back xcode and save storyboard again
* Switch back to Xamarin Studio
* Wait for code generation


Expected: The RootViewController.cs and RootViewController.designer.cs should be regenerated.

Actual: The RootViewController.cs is regenerated but you get TWO RootViewController.designer.cs attached to the project.

* Try to fix problem by deleting duplicate file
* Remove one of the RootViewController.designer.cs from project by right click in Solution Tree.


Expected: Duplicate (that should not exist in first place) should be removed.

Actual: An exception

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[MonoDevelop.Projects.SolutionEntityItem,MonoDevelop.Core.Collections.Set`1[MonoDevelop.Projects.SolutionEntityItem]].ContainsKey (MonoDevelop.Projects.SolutionEntityItem key) [0x00099] in /private/tmp/source/bockbuild/profiles/mono-2-10/build-root/mono-2.10.12/_build/mono-2.10.12.git/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:494 
  at MonoDevelop.Core.Collections.Set`1[MonoDevelop.Projects.SolutionEntityItem].Add (MonoDevelop.Projects.SolutionEntityItem item) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Collections/Set.cs:50 
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFileNodeCommandHandler.DeleteMultipleItems () [0x00031] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:282 
  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) [0x000d5] in /private/tmp/source/bockbuild/profiles/mono-2-10/build-root/mono-2.10.12/_build/mono-2.10.12.git/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- 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) [0x000eb] in /private/tmp/source/bockbuild/profiles/mono-2-10/build-root/mono-2.10.12/_build/mono-2.10.12.git/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source/bockbuild/profiles/mono-2-10/build-root/mono-2.10.12/_build/mono-2.10.12.git/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at MonoDevelop.Components.Commands.DefaultCommandHandler.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00018] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:2031 
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:101 
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler+TransactedNodeHandlerAttribute.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00026] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:296 
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.MonoDevelop.Components.Commands.ICommandTargetHandler.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:58 
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.Command cmd) [0x00017] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1919 
  at MonoDevelop.Components.Commands.CommandManager+<DispatchCommand>c__AnonStorey73.<>m__C7 () [0x0003d] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1045 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x0029e] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1062