Ask before moving files in Solution Explorer tree.
Accidentally moving files to random directory really annoys.
I and many developers I know have suffered dragging files accidently, from one location to other in the Visual Studio Solution Explorer.
If the solution is in a source control and not checked out, VS prompts to check out (if configured to do that) but in any other case the situation can get very frustrating.
It would be great to have a confirmation prompt when the user drags a file from one location to another in the solution explorer.
I have heard of a way to completely block drag and drop functionality using a VS extension.
But it sounds like a workaround as drag and drop is very handy while solution restructuring / re-factoring.
Adam J. Sycz commented
+1 on this. Drag-n-Drop is great and all but those accidental drag moves can really ruin my day sometimes. Ability to either a) lock file b) have alert banner with Undo action or c) prompt window popup (probably least desired but I'd take it to save my time and sanity).
Por favor, hagan que se pida confirmación cuando se mueven carpetas/archivos a otras carpetas. Se pierde mucho tiempo re ordenando cuando sucede por accidente, si es que uno se da cuenta.
Simon Weaver commented
I guess democracy doesn't work after all.
Fortunately it was ONLY my ENTIRE MVC 'Areas' folder that got moved and had to be renamed in TFS too. And only took 20 minutes to undo
Simon Weaver commented
1050 votes? Isn't that a lot of votes - I can't stand how this isn't fixed. Especially with source control it's a nightmare. One accidental drag takes an hour to fix. I want to smash stuff now.
Javier Goldman commented
how isnt this fixed already, also +1 for devuxer's solution
Because it's an accidental move, I'd prefer to just be alerted with a modal.
+1 for devuxer's solutions. That would be awesome.
David Janke commented
the drag-and-drop feature seems like an unnecessary optimization.
what exactly is the use case for drag-and-drop moves in Solution Explorer, anyway? Who frequently moving around so many files that they need a fast UI (i.e. where menu-drive move causes too much overhead)?
if you are moving files in your solution so often that you *need* drag-and-drop… I think you are doing something fundamentally wrong in your dev process
+1 for devuxer´s solution! would also be nice in windows explorer :)
I love devuxer's solution!
Asif Iqbal commented
for some cases ctrl + Z worked fine for me...
I prefer just having a colored banner appear at the top of the Solution Explorer after files are moved that says "5 files were moved. [Undo] [X]". This same technique could be used for other potentially destructive actions too, such as deleting files. This is a proven technique used in GMail and other successful user interfaces. It is not disruptive to the user's workflow -- if you intended to move the files, you just keep on going, and if you didn't, you click Undo. If the banner annoys you, you can close it.
The problem with a lock/unlock mode switch is that it will introduce "mode errors", which is when a user forgets which mode they're in ("Oh no, I forgot to put it in lock mode and now I don't know which file I just moved" or "Why aren't these files moving when I drag them?"). Also, there are enough small icons in the Solution Explorer as it is, adding more would not be helpful.
Having a simple lock/unlock icon on the solution explorer (that defaults to unlocked) could be a simple affordance that doesn't break the current experience/flow but can allow people to disable dragging if they choose.
Aaron Barker commented
it should be a toggle setting to ask before moving a file or folder - I rarely move files in my solution; when I do it's usually an accident
When connected to a web site via FTP in VS, opening a file in solution explorer leaves VS hanging, and it can only be killed in taskmanager. Disabling VSCommand resolves this.
It is beyond me why Microsoft hasn't made it a feature in VS to prompt before dragging and dropping files and folders in solution explorer.
It can happen very easily by accident, and can have terrible consequences when working on a website via FTP.
Sam Blowes commented
For anyone that really needs this feature now, a plugin named VS commands can do this.
Jonathan Gilbert commented
With regard to having an Undo feature -- that would be a good idea, but I still feel that there should be an option to prevent the accidental move or copy from happening in the first place. The reason is that when working with TFS, the move operation must talk to the server to schedule the move of each affected file. If a directory with dozens of files is accidentally moved, it can take several minutes for all this activity to die down -- an 'Undo' button would then repeat the process in reverse. I've had to deal with this time-consuming frustration in exactly this manner before (except that the 'Undo' was, of course, done manually in the absence of an automatic function).
@MichaelDaw, I agree with the problem but not the proposed solution. The "proper" solution (IMO) is to provide an undo capability for the solution explorer. This way, your flow is not interrupted when you intentionally move something, but if you accidentally move something, it can be easily reversed.
If you're thinking of adding this, don't. But if you do, at least provide the option to turn it off. More interruptions are not needed.
Wagner Wagner commented
Yeah, I usually ***** up projects, because sometimes I don't recognize when I do it accidentally.