The official source of product insight from the Visual Studio Engineering Team
Have you ever found yourself wishing you could roll back a few hours to a piece of code you had working but have made changes to? You were “in the flow” and you haven’t checked anything in to your source control system (or perhaps weren’t using source code control on your project)?
We are pleased to announce the availability of an early preview of an extension on the Visual Studio Gallery to give you automatic, no-configuration history tracking for your local machine. Just install the extension, and whatever you do to your projects and solutions, it silently and efficiently tracks the changes you make to any files that you have opened in the Visual Studio Editor. Then, when you find yourself in need of back-tracking to an earlier version of one or more of your files, you can find your way back to it.
Check out this video to see the extension in action or Channel 9 Toolbox video for full details.
Once the extension is installed, you simply work as you normally would. There’s nothing more for you to configure. Later on, when you need to find your way back, simply bring up the Auto History tool window (it will open automatically when you first install the extension, but if you’ve closed it you can easily bring it back by clicking View..Other Windows...Auto History):
The extension automatically captures a “Snapshot”, which is an image of all the files in your solution that you have opened in the editor at a particular point in time, every time you save, open, close, or reload a file. A snapshot is also automatically triggered every 5 minutes (a little like the “Auto Save” feature in programs like Microsoft Word), and you can force a snapshot to be taken by pressing the “Take Snapshot” Button.
The Extension’s window gives a view of all the snapshots which have been captured from your activity. By default the list is filtered to show snapshots only from the currently open solution. The left hand side of the window shows a set of tick marks (one for each event that led to snapshot being captured), from which you can select a range (indicated by the shaded rectangle overlaid on the tick marks) to make comparisons between the snapshots
In the screenshot above you can see that between now and a point yesterday, I made changes to two files in my solution (Program.cs and Utilities.cs). If I want to see details of the changes I can just double click on any of the files in the list, to see a view of changes to that file. Let’s take a look at program.cs:
In this diff, I can easily see the changes I made since the earlier snapshot – and quickly copy and paste any old code I want to from the difference view. I never checked in to a source control system, but Auto History took care of letting me get back to my earlier code with ease!
Note that although you will most likely want to make comparisons between a past and current state, the extension also allows you to compare two distinct points in the past; you can do this by dragging the top part of the shaded rectangle over the tick marks down from the “Now” indicator to your chosen end point.
In future releases of the extension we’re considering more automatic roll back features, and we’re interested to hear from you about the sort of roll-backs you’d find most useful.
By default the Auto History window shows a view filtered to your current solution. There are times when you might want to use other filters, available in the top of the window:
All Files – this filter lets you see ANY file that has been edited in Visual Studio on the current machine – this can be useful if you want to see changes you made in another project but apply the changes to your current one, or if you’re not quite sure which solution held the change you’re looking for.
Current File – if you know that the older code you’re after is in the file you currently have open in the editor, you can use this filter to simplify the history down to only that file
Searching by filename - when your changed file list is long, you’ll probably find it helpful to be able to filter down using a filename search. Just enter a complete or partial filename into the box and the list of files will narrow down according to that search term.
Note that the filters you choose will also affect the Snapshot ticks shown in the extension’s window – so if you filter down to a particular file for instance, you can expect to see only tickmarks for those snapshots where that file changed from the previous snapshot. This helps you focus in on only the parts of the history you are interested in.
The extension doesn’t have any direct interaction with Source Code Control Systems, and doesn’t require you to be using one, nor to change the way you work with one you might already be using. For a source code control user, the extension is useful because it keeps a history of your files between Source Code Control checkins
If you are using a Source Code Control System, events that cause filesystem changes (such as checkins, which require a save) will show up in the extension’s snapshot list.
This extension is a work in progress, and we’re very keen to hear your feedback – whether it’s useful to you and any capabilities you’d like it to have. Go grab the extension from the Visual Studio Gallery and tell us what you think!
Brilliant idea! I will certainly give it a try.
I might often have the same one code file open for hours on end, doing saves after almost every change I make (a bad habit from when software crashed a lot more). Would this extension generate a delta for each Ctrl+S? If it did I could see the list of changes getting pretty hard to wade through.
This is a very interesting idea. Great you guys did it for us. Thank you!
Thanks for the feedback @Pedro, @Dmitry and @Martin. We're interested to hear how you find the extension as you try using it day by day. @Martin, yes, the extension will generate a snapshot for all Ctrl+S's you do. We realize this will cause a lot of ticks in the snapshot list for those with a strong "Save reflex" - and we also take auto-save snapshots every 5 minutes for open files. That way we have the best chance of ensuring we capture the moment you want to get back to. We could turn the snapshotting frequency/trigger events down, however, we hope that the filtering and grouping features in the extension make it relatively easy to find your way back to the moment you are interested in. If you have suggestions for filtering and grouping capabilities we'd be very interested to hear about them.
This is really cool, a nice compliment to TFS. Thanks!
Unfortunately, doesn't work: the Auto History option does not appear!
What happens when you click View..Other Windows... does the Auto History option show up on the menu for you?
If not you may be suffering from an install issue some users are seeing. We will be shipping an update to the extension shortly - please watch this space.
I was excited about this extension after watching the CH9 video... then disappointed to see the download was only for VS 2013. Any chance of a version for VS 2012?
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
The extension fails to load and I get this message when I open Visual Studio 2013 Professional.
The 'LocalHistoryPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\<redacted>\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml'.
Looking at the file I can see the following:
<description>Begin package load [LocalHistoryPackage]</description>
<description>CreateInstance failed for package [LocalHistoryPackage]</description>
<errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)</errorinfo>
<description>End package load [LocalHistoryPackage]</description>
<hr>80004005 - E_FAIL</hr>
Having exact the same issues when starting up VS2013:
(It's german but FYI it says it could load the package because autohistory.dll or one of its dependencies couldn't be found...
<errorinfo>Die Datei oder Assembly "file:///C:\Users\kreich\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\4p34xjbt.cya\Microsoft.VisualStudio.AutoHistory.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Fehler bei der Überprüfung des starken Namens. (Ausnahme von HRESULT: 0x8013141A)</errorinfo>
Having the same loading issues as others are having. Visual Studio Ultimate with ReSharper.
then commit more often ;)
Same problem here, but I don't use Resharper, I use DevExpress Coderush.