Syncing Visual Studio Extensions and Settings with Dropbox
Sparked by a long wish for keeping my Visual Studio extensions and settings in sync across multiple computers, and a discussion with @kellabyte and @ackenpacken yesterday, I started to research how this could be done.
With a quick Google search, I found this blog post by the Visual Studio team, describing where Visual Studio 2010 looks for its extensions. The blog post specified \Common7\IDE\devenv.pkgdef as the file to modify in order to load extensions from additional places than the default ones you get “out of the box”. Further down in the blog post, PkgDefSearchPath was listed, and it seemed like a good to add a folder controlled by Dropbox. On my computers, this would typically be C:\Users\larsw\Dropbox\Visual Studio Settings and Extensions.
Before you start poking around in the file, I suggest you take a backup of the original one, in case of any f*ckups. As you can see from the default entry, it contains three paths in a semi colon separated list. I just apppended my chosen folder to the end of this list like:
C:\Users\larsw\Dropbox\Visual Studio Settings and Extensions”
Before you start editing the file, I suggest you shut down all instances of Visual Studio, so the likelihood that the file won’t be write-protected or changed is minimal.
Migrating existing extensions
In the same pkgdef file, UserExtensionsRootFolder points at the default location for user-defined extensions – in my case, it points to c:\Users\larsw\AppData\Local\Microsoft\VisualStudio\10.0\Extensions. I chose to move all the sub folders (containing extensions) into my newly created Visual Studio Settings and Extensions folder controlled by Dropbox. As for the extensions located in the folder defined by ApplicationExtensionsFolder, I chose to let them be for know, because I suspect that they are having dependencies on native components etc. There were a lot of Microsoft default extensions, as well as JetBrains Resharper etc. located in the folder.
On my other computers, I had to update the same pkgdef file, let Dropbox sync the folder, start Visual Studio – & voila! The same extensions were present
As for Visual Studio settings, it’s a supported functionality out of the box to share settings between Visual Studio instances across machines via (typically) a file share. The same functionality can of course be used with Dropbox. Go to Tools –> Options –> Environment –> Import and Export Settings, and point to a location inside the same Dropbox-controlled folder.