Monthly Archives: August 2013

Visual Studio keyboard shortcut to collapse and expand code

Sometimes in Visual Studio you need to collapse all code to give your mind a quick clean and refresh, at least I feel it helps.

The Visual Studio keyboard shortcut to do this is as follows:

Ctrl + M + O for collapse

Ctrl + M + L for expand.

StackOverflow has a very popular question and answer with the shortcuts which leads me to believe that I cannot be alone in my need to occasionally collapse all to preserve my sanity.

Testing on the Toilet – Google Testing Blog

Google employees maintain a blog about testing.

They have a series titled ‘Testing on the Toilet’. Each short article teaches something short about testing. They are short enough to be read while on the toilet, hence the title of the series. Apparently, at Google, they print them out and leave them in toilets so their employees have something to read.

The explanation or introduction of Testing on the Toilet.

Although I don’t plan on reading them while on the toilet they are really short and informative to read every now and again, or one each day, for example.

I suggest every developer should read some.

If for example, you are still not sure what the difference between mocks, stubs, fakes, dummies, test doubles and test spies are, the answers are all in ‘Testing on the Toilet’.

AnkhSVN – Subversion Support for Visual Studio


In this post I will explain how to install and setup AnkhSVN, subversion support for Visual Studio.


Download AnkhSVN

Run the installer to install AnkhSVN.

Before you can interact with Subversion directly and comfortably through Visual Studio, you must tell Visual Studio to use AnkhSVN.

To do this, go to:

Tools > Options > Source Control

and select ‘AnkhSVN – Subversion Support for Visual Studio’.


The following Visual Studio window is now visible:


allowing one to see non-commited changes, commit changes, update to receive the most recent changes, etc.


Having Subversion integrated into Visual Studio is a productivity boost as opposed to using TortoiseSVN from windows explorer:


NuGet 2.7 Release Candidate

NuGet is a package manager for .NET. It provides an easy way to download and include packages directly from Visual Studio. You can create your own NuGet repository containing any package you may have developed.

Before version 2.7 integrating NuGet with source control was not seamless, you had to jump through some hoops. Namely, you had to enable ‘NuGet Package Restore’ by right-clicking your solution. So when you checked out and built NuGet would automatically download any missing dependencies.

nuget 2.7

If you google ‘nuget auto restore not working’ you will see that many people have trouble setting this up properly. In summary, it takes up valuable time.

NuGet 2.7 enables Package Restore by Default which is great. No more remembering to manually enable it on your Visual Studio solution. This change is very welcome.


Visual Studio 2013 Preview

Visual Studio 2012 was released Q4 of last year and already we have a replacement; Visual Studio 2013.

Download and Installation


On the page, select ‘Visual Studio Ultimate 2013 Preview’ ‘Install Now’. You download a small 1MB file which downloads and installs the whole IDE. I installed it in a VM of Windows 8.1. It took a while, around 30 minutes.


When installation is complete you are required to sign into your Microsoft account (or ‘Visual Studio’ account), apparently Visual Studio syncs with other devices (awesome)!


Next, you choose the theme. I like the new grey Visual Studio 2012 theme but if you prefer you can choose the old Visual Studio 2010 blue theme.

Choose your development environment (C# for me) and click start. The welcome screen looks very familiar:


There is an update to install as soon as you install the ide.

Reference couting

Let’s start a new Console app. The first change you notice is the reference counting. Each class and method has a little indicator above it telling you how many times it is being referenced.


When you hover over the reference indicator it shows you where it is being referenced. In the following screenshot, it’s the constructor.


I now reference the Play class from my main method:


It’s kinda cool. You can now see, at a glance, which of your classes are heavily referenced and which are not. One could use this tool to focus your unit testing efforts on classes that are relatively heavily referenced.

Return Values Debugging

Return values in the Visual Studio debugger. The Autos window displays return types and values for methods.

(You must start the debugger and hit a breakpoint to be able to see the Auto window.)


I honestly don’t use the auto window, I probably should. I didn’t know Visual Studio 2012 lacked this feature but it’s nice to now have it. My auto window is now open and I’ll use it when I am debugging.

Edit and Continue for 64-bit apps

Have you ever received the ‘Changed cannot be made to 64-bit applications’ message? I know I have. Apparently Visual Studio 2013 supports this.

Async debugging

Peak Definition and Scrollbar enhancements

I love these two features of Productivity Power Tools. It’s now in Visual Studio natively.

See what else is new or different in Visual Studio 2013

See what else is new in .NET 4.5.1