Tuesday, February 19, 2013

Building my Visual Studio workplace from scratch

I hate reinstalling my development machine, because it's tedious and boring task to make it "as it was before". I have several tools that need to install besides Visual Studio, some extensions in Visual Studio and tons of settings that I prefer than the default one. I would love to see "Upload my machine settings to live.com account" and "Restore my settings from live.com" options in the next Windows releases ... until then we will have to find our way through this challenge.

Visual Studio settings I always change

In the "Source control" settings, I always enable "Get latest version of item on check-out...", "Show deleted items on Source Control Explorer","Get everything when solution is opened" and disable "Attempt to automatically resolve conflicts when they are generated" - the last one can cause a lot of pain.

Additionally, I have to Configure the user tools as I don't really like the default compare and merge tools (even the new one in Visual Studio 2012). I use WinMerge for both operations so I have to add new user tools:
Extension .*; Operation Compare; Command C:\Program Files (x86)\WinMerge\WinMergeU.exe; Arguments /e /u /wl /wr /dl %6 /dr %7 %1 %2

Extension .*; Operation Merge; Command C:\Program Files (x86)\WinMerge\WinMergeU.exe;
Arguments /e /u /wl /dl %6 /dr %7 %1 %2 %4

Something else I usually do is to enable the Line numbers for all languages - not sure why by default they are on for a subset only.

Visual Studio extensions

SlowCheetah - XML Transform is an extension for building configuration transformations for your app.configs or whatever xml files you use.

Spell Checker - another extension that has saved me a lot of times. 

XAML Regions is something I already wrote about how useful could be.

And a bunch of Telerik products' extensions - JustCode, JustMock, OpenAccess, Sitefinity Thunder, etc.

I also add one external tool that executes undo operation to all pending changes that has no changes (the files has only been checked out, but no modified).
Title: Unfo fake changes;
Command %windir%\System32\cmd.exe;
Arguments /C echo y | "%ProgramFiles(x86)%\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE" uu /recursive /noget;
Initial directory $(SolutionDir)
All credits for this tool goes to this guy

Storing your Visual Studio settings in the cloud

Recently, I found one awesome feature of JustCode - store your Visual Studio settings in the cloud (this should probably be incorporated on the logo, so everyone can see it). This saved me probably 30% of the work last time I had to pre install my PC. Just make sure to mark all settings for storing - by default some settings that are subject to intellectual property are not selected. And of course it can store your JustCode settings which is quite beneficial as well. What's even better - I can sync my settings on my work PC and on my PC so I can have unified experience no matter where I am. 

One tip that I always forget to follow - after you set up your new environment, create a new workplace in TFS, otherwise your TFS status will be scrambled - Visual Studio will think you have the latest version of the file, while the file is not on your file system at all.

With this post I hope that someone's else reinstallation will be easier and faster. Or at least will give you a tip on how to improve your current set up.