Bug 2755 - Cut/pasting folder fails with exception
Summary: Cut/pasting folder fails with exception
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-05 18:53 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-01-09 16:51 UTC (History)
3 users (show)

Tags: papercut
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 Mikayla Hutchinson [MSFT] 2012-01-05 18:53:58 UTC
Copying and pasting a folder in the solution pad can cause the following exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MonoDevelop.Ide.ProjectOperations.<TransferFiles>b__46(ProjectFile f) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\ProjectOperations.cs:line 1613
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at MonoDevelop.Ide.ProjectOperations.TransferFiles(IProgressMonitor monitor, Project sourceProject, FilePath sourcePath, Project targetProject, FilePath targetPath, Boolean removeFromSource, Boolean copyOnlyProjectFiles) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\ProjectOperations.cs:line 1613
   at MonoDevelop.Ide.Gui.Pads.ProjectPad.FolderCommandHandler.DropNode(Set`1 projectsToSave, Object dataObject, DragOperation operation) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui.Pads.ProjectPad\FolderNodeBuilder.cs:line 311
   at MonoDevelop.Ide.Gui.Pads.ProjectPad.FolderCommandHandler.OnMultipleNodeDrop(Object[] dataObjects, DragOperation operation) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui.Pads.ProjectPad\FolderNodeBuilder.cs:line 170
   at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.OnMultipleNodeDrop(Object[] dataObjects, DragOperation operation, DropPosition position) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui.Components\NodeCommandHandler.cs:line 254
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.PasteToCurrentItem() in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide.Gui.Components\ExtensibleTreeView.cs:line 1095
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at MonoDevelop.Components.Commands.CommandHandlerInfo.Run(Object cmdTarget, Command cmd) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 1433
   at MonoDevelop.Components.Commands.CommandManager.<>c__DisplayClassb.<DispatchCommand>b__2() in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 644
   at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(Object commandId, Object dataItem, Object initialTarget, CommandSource source) in c:\Users\Michael\work\monodevelop\main\src\core\MonoDevelop.Ide\MonoDevelop.Components.Commands\CommandManager.cs:line 661
Comment 1 Mikayla Hutchinson [MSFT] 2012-01-05 18:55:42 UTC
Fixed in master.
Comment 2 lindsey.driscoll 2012-02-29 11:54:29 UTC
This error/exception does not happen the first time you cut and paste a folder, but it happens when you cut and paste the same folder again. Even if you close the solution, re-open it and try to cut/paste the exception is thrown.


Steps to reproduce:

Screencast: http://screencast.com/t/nP4SOy6Pslmd


Environment:

MonoDevelop: 2.8.6.5
Mono: 2.10.8
Mac OSX: Lion


Error:

Error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.Ide.ProjectOperations.<TransferFiles>m__1B9 (MonoDevelop.Projects.ProjectFile f) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:1620 
  at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator35`1[MonoDevelop.Projects.ProjectFile].MoveNext () [0x00059] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.Core/System.Linq/Enumerable.cs:3010 
  at System.Collections.Generic.List`1[MonoDevelop.Projects.ProjectFile].AddEnumerable (IEnumerable`1 enumerable) [0x0001a] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Collections.Generic/List.cs:126 
  at System.Collections.Generic.List`1[MonoDevelop.Projects.ProjectFile]..ctor (IEnumerable`1 collection) [0x0002f] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Collections.Generic/List.cs:63 
  at System.Linq.Enumerable.ToList[ProjectFile] (IEnumerable`1 source) [0x00006] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/System.Core/System.Linq/Enumerable.cs:2847 
  at MonoDevelop.Ide.ProjectOperations.TransferFiles (IProgressMonitor monitor, MonoDevelop.Projects.Project sourceProject, FilePath sourcePath, MonoDevelop.Projects.Project targetProject, FilePath targetPath, Boolean removeFromSource, Boolean copyOnlyProjectFiles) [0x0024b] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:1620 
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.FolderCommandHandler.DropNode (MonoDevelop.Core.Collections.Set`1 projectsToSave, System.Object dataObject, DragOperation operation) [0x00609] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:311 
  at MonoDevelop.Ide.Gui.Pads.ProjectPad.FolderCommandHandler.OnMultipleNodeDrop (System.Object[] dataObjects, DragOperation operation) [0x00013] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:170 
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler.OnMultipleNodeDrop (System.Object[] dataObjects, DragOperation operation, DropPosition position) [0x00007] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:254 
  at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.PasteToCurrentItem () [0x00074] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:1095 
  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/monobuild/build/BUILD/mono-2.10.8/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/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.8/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.Command cmd) [0x00029] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1433 
  at MonoDevelop.Components.Commands.CommandManager+<DispatchCommand>c__AnonStorey42.<>m__57 () [0x0003d] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:644 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x0029e] in /Users/builder/data/lanes/monodevelop-mac-2.8.6.5/96a2067d/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:661
Comment 4 Jeffrey Stedfast 2013-01-09 16:51:35 UTC
this has been fixed