TFS Express done right

In my previous post about TFS Express I installed it side-by-side with Visual Studio 2010. This gave me some compatibility issues when running unit tests with code coverage. To be able to demo some things offline I did needed a working environment and installed a fresh Windows 8 machine with Visual Studio 2012 and TFS Express.

The installation was with all the defaults just a clicking exercise. Now with compatible versions of Visual Studio and TFS I can just create a new Team Project. To demonstrate unit testing with code coverage in the build I created a simple solution with two projects, one of wich is the test project. Don’t forget to check in everything, or your first build will fail and you never know why. Didn’t happen to me, no really. Okay.

Time to create the build definitions. Go to the Team Explorer and click on the Header and select the Builds. Click New Build Definition.

  • General tab: Give it a nice name.
  • Trigger, Workspace and Retention Policy tab: Leave it to defaults for demo purposes.
  • Notice the exclemation mark next to Build Defaults. This is because there is no Staging location specified. Just set the option to not copy to a drop folder.
  • Process tab: Edit the Automated Tests, Edit the Test Run and see some interesting settings. Make sure to select Enable Code Coverage in Options.

Microsoft describes the differences between Test Runner and MSTest in msdn article Run Tests in Your Build Process For my demo I want to use both as the results should be the same. To use the MSTest as the test runner I have to add a testsettings file to the solution. Go to Data and Diagnostics and Enable Code Coverage. Be sure to click the Configure and select the assemblies to be instrumented.

Now I have two build definitions, one with Test Runner and one with MSTest. Both do the build, but testing is a little different when it comes to code coverage. When using the Test Runner both assemblies get instrumented and produce code coverage, where with MSTest I can specify what assemblies to instrument. This default instrumentation of all assemblies can be overwritten by using the same testsettings file for the Test Runner. So it all comes down to your needs which test runner to select.

From the Build Summary you can select the Hyperlink to view the actual Test Results and from there the Code Coverage Results (context menu of the Test Results)

I’m happy with the local installation of Visual Studio and TFS Express for my demos. For real projects I still prefer the online TFS Preview, but that is because it is still free at the writing of this post.

Posted in Tooling | Tagged , , , , , | 1 Comment

No Hyper-V for you!

I want to use Hyper-V from Windows 8. But the “Turn Windows features on or off” wizard has Hyper-V platform grayed out. Telling me the processor misses SLAT in the tooltip.

Turn Windows features on or off with Hyper-V platform grayed out

My machine has an older Core 2 Duo T5500 processor that supports Hardware Virtualization in the BIOS. But this SLAT is something else and can be detected with Coreinfo.

Coreinfo

This showed my processor was laking the SLAT, which is called EPT by intel. By the way the dash means missing.

Posted in Tooling | Tagged , , , , , | Leave a comment

Windows 8 Release Preview to RTM

Up first: an upgrade from Release Preview (build 8400) to RTM (build 9200) is not possible.
windows 8 upgrade not possible message

As so many people I installed the Developer Preview, the Consumer Preview, the Release Preview and the RTM. Every new version was a clean install from USB stick thanks to the USB/DVD downoad tool. Never had any problems with the previews, but the RTM showed “missing media driver”.

Turns out there is an old (2007) Windows XP post from Naxxfish giving me a workaround by adding the SATA driver to the USB stick. To extract the image I used 7-zip that supports the exe and the ima file. Running Windows 8 Build 9200 now.

Posted in Tooling | Tagged , , , , , , , , | 1 Comment

switch code snippet power

Today I discovered the code snippet with the best timesaving ever: switch. You can use it from the snippet menu (CTRL + K, X)

or you can simply type switch and use code completion (CTRL + SPACE and TAB)

Then replace the switch_on placeholder with your expression and press arrow down. Now every enum value is a case statement. No more typing everything.

Whenever I find myself typing stuff that could be concluded from declarations I might end up using a code snippet.

Posted in Development | Tagged , , , , , , , | Leave a comment

Recover lost photos with PhotoRec

My neighbour accidently deleted all photos on the camera without having them transfered to the harddisk. The SD card was never used before and the card was not formatted after deleting all photos. This should be recoverable.

From lifehacker.com I was directed to PhotoRec to recover lost photos. PhotoRec scans the disk and looks for files based on the unique blocks filetypes start with and recovers every file it can read.

screenshot of photorec in process

The process took about 15 minutes and recovered 250 Mb of photos from a 4Gb SDHC card. Making the neighbour jump for joy and providing me a new blog topic.

Posted in Tooling | Tagged , , , , , , , , , , | 1 Comment