Bug 14690 - Exception is raised on attempt to rename a class
Summary: Exception is raised on attempt to rename a class
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 4.0.12
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 5.10 (C6)
Assignee: Marius Ungureanu
URL:
Depends on:
Blocks:
 
Reported: 2013-09-12 14:05 UTC by Ievgen
Modified: 2015-09-01 08:54 UTC (History)
3 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 Ievgen 2013-09-12 14:05:32 UTC
1) Create a class in a sub folder folder (SubFolder)
2) Make sure that namespace of the class reflects subfolders structure (MyProject.SubFolder)
3) Using Solution Navigator move class file outside the folder into the root folder
4) Open class file and run Refactoring tool to rename the class

ACTUAL RESULT
On attempt to rename the exception is raised (@@@ strips my personal data):

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: /Users/@@@@@@/Sites/@@@Solution/@@@.iOS/Controls/ExtendedCollectionView.cs does not exist
File name: '/Users/@@@@@@/Sites/@@@Solution/@@@.iOS/Controls/ExtendedCollectionView.cs'
  at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x0013a] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.IO/File.cs:319 
  at MonoDevelop.VersionControl.Repository.OnMoveFile (FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor) [0x0000d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:506 
  at MonoDevelop.VersionControl.Git.GitRepository.OnMoveFile (FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor) [0x0002c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:1435 
  at MonoDevelop.VersionControl.Repository.MoveFile (FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor) [0x0002d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:501 
  at MonoDevelop.VersionControl.VersionControlFileSystemExtension.MoveFile (FilePath source, FilePath dest) [0x00030] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:61 
  at MonoDevelop.VersionControl.VersionControlFileSystemExtension.RenameFile (FilePath file, System.String newName) [0x0001c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:75 
  at MonoDevelop.Core.FileService.InternalRenameFile (System.String srcFile, System.String newName) [0x00011] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs:196 
  at MonoDevelop.Core.FileService.RenameFile (System.String oldName, System.String newName) [0x00036] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs:136 
  at MonoDevelop.Refactoring.RenameFileChange.PerformChange (IProgressMonitor monitor, MonoDevelop.Refactoring.RefactoringOptions rctx) [0x0001e] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs:234 
  at MonoDevelop.Refactoring.RefactoringService.AcceptChanges (IProgressMonitor monitor, System.Collections.Generic.List`1 changes, ITextFileProvider fileProvider) [0x00037] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs:164 
  at MonoDevelop.Refactoring.RefactoringService.AcceptChanges (IProgressMonitor monitor, System.Collections.Generic.List`1 changes) [0x00008] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs:154 
  at MonoDevelop.Refactoring.Rename.RenameItemDialog.OnOKClicked (System.Object sender, System.EventArgs e) [0x0003d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:176 
  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) [0x00054] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230 
  --- 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) [0x00069] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:238 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MethodBase.cs:114 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000d5] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/Delegate.cs:424 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/MulticastDelegate.cs:72 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/Delegate.cs:398 
  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 Marius Ungureanu 2015-09-01 08:54:36 UTC
This is no longer an issue in 5.10. We have unit tests which test this behaviour.