Auto History Extension in Visual Studio 2013

Auto History Extension in Visual Studio 2013

Rate This
  • Comments 66

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.

Finding your way back…

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):

Auto History Tool Window under View, Other Windows 

Snapshots – Your file activities, captured

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

Comparison between 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:

Viewing changes in a file 

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.

Filtering down the list of changed files

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:

Filters in Auto History tool window available at top of 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.

How does this work with Source Code Control Systems?

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.

Get the extension now, and give us your feedback!

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!

Mark Mark Wilson-Thomas

Mark Wilson-Thomas is a Program Manager on the Visual Studio team, currently working on the Visual Studio Editor. He has worked on developer tools for the last 8 years, including tools for Office, SQL and XAML. Prior to moving to the US he was a consultant in Microsoft Consulting Services in the UK on large scale projects. Prior to joining Microsoft, he worked for BP Oil plc as a Process Modelling Chemist, and for QA plc building web-based Learning Management Systems.
Leave a Comment
  • Please add 1 and 5 and type the answer here:
  • Post
  • 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.

    Thanks

    Mark

  • This is really cool, a nice compliment to TFS. Thanks!

  • Unfortunately, doesn't work: the Auto History option does not appear!

  • Hi @Ricardo

    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.

    Thanks

    Mark

  • 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.

             C:\USERS\*USERNAME*\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0\EXTENSIONS\KXBCENVD.D23\AdornmentManager.dll   Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost

  • ActivityLog.xml:

    Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

  • Hi

    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:

     <entry>

       <record>424</record>

       <time>2014/01/24 07:52:55.884</time>

       <type>Information</type>

       <source>VisualStudio</source>

       <description>Begin package load [LocalHistoryPackage]</description>

       <guid>{3A6E8827-8C64-42EC-B83A-9CA32DA7BBF5}</guid>

     </entry>

     <entry>

       <record>425</record>

       <time>2014/01/24 07:52:55.898</time>

       <type>Error</type>

       <source>VisualStudio</source>

       <description>CreateInstance failed for package [LocalHistoryPackage]</description>

       <guid>{3A6E8827-8C64-42EC-B83A-9CA32DA7BBF5}</guid>

       <hr>8013141a</hr>

       <errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)</errorinfo>

     </entry>

     <entry>

       <record>426</record>

       <time>2014/01/24 07:52:55.898</time>

       <type>Error</type>

       <source>VisualStudio</source>

       <description>End package load [LocalHistoryPackage]</description>

       <guid>{3A6E8827-8C64-42EC-B83A-9CA32DA7BBF5}</guid>

       <hr>80004005 - E_FAIL</hr>

       <errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)</errorinfo>

     </entry>

  • 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...

    <entry>

       <record>738</record>

       <time>2014/01/24 08:28:26.818</time>

       <type>Error</type>

       <source>VisualStudio</source>

       <description>End package load [LocalHistoryPackage]</description>

       <guid>{3A6E8827-8C64-42EC-B83A-9CA32DA7BBF5}</guid>

       <hr>80004005 - E_FAIL</hr>

       <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>

     </entry>

  • Having the same loading issues as others are having. Visual Studio Ultimate with ReSharper.

    Could not load file or assembly 'Microsoft.VisualStudio.AutoHistory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

    Best,

    Mark Monster

  • then commit more often ;)

  • Same problem here, but I don't use Resharper, I use DevExpress Coderush.

Page 1 of 5 (66 items) 12345