Bug 4874 - Delete file from solution gives exception
Summary: Delete file from solution gives exception
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 2.9.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-04 04:46 UTC by Jaapjan
Modified: 2012-05-04 08:12 UTC (History)
2 users (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 Jaapjan 2012-05-04 04:46:02 UTC
Description of Problem:

Cannot delete a file using the solution pad.

Steps to reproduce the problem:
1. Start console solution
2. Delete main.cs from project

Actual Results:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: path2
  at System.IO.Path.Combine (System.String path1, System.String path2) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.FilePath.Combine (System.String[] paths) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ProjectFile.get_DependencyPath () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.UnresolvedFileCollection.Remove (MonoDevelop.Projects.ProjectFile file) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Project.NotifyFileRemovedFromProject (IEnumerable`1 objs) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Project.OnItemsRemoved (IEnumerable`1 objs) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.DotNetProject.OnItemsRemoved (IEnumerable`1 objs) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ProjectItemCollection`1[MonoDevelop.Projects.ProjectItem].NotifyRemoved (IEnumerable`1 items, Boolean comesFromParent) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ProjectItemCollection`1[MonoDevelop.Projects.ProjectItem].MonoDevelop.Projects.IItemListHandler.InternalRemove (IEnumerable`1 objs, Boolean comesFromParent) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ProjectItemCollection`1[MonoDevelop.Projects.ProjectFile].NotifyRemoved (IEnumerable`1 items, Boolean comesFromParent) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ProjectItemCollection`1[MonoDevelop.Projects.ProjectFile].OnItemRemoved (MonoDevelop.Projects.ProjectFile item) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.ItemCollection`1[MonoDevelop.Projects.ProjectFile].RemoveItem (Int32 index) [0x00000] in <filename unknown>:0 
  at System.Collections.ObjectModel.Collection`1[MonoDevelop.Projects.ProjectFile].Remove (MonoDevelop.Projects.ProjectFile item) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFileNodeCommandHandler.DeleteMultipleItems () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.DeleteCurrentItem () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.OnKeyPress (System.Object o, Gtk.KeyPressEventArgs args) [0x00000] in <filename unknown>:0 
  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 

Expected Results:

The file deleted on disk and removed from the solution.

How often does this happen? 

Everytime you use delete.
Comment 1 Lluis Sanchez 2012-05-04 08:12:38 UTC
Fixed in master.