fd Blog

Daniel Hilgarth on software development

How to Register a MSSCCI Source Control Plugin on a 64 Bit Machine

More a reminder for myself than anything else:

To register a MSSCCI source control plugin (nowadays called Source Control Plug-in) on a 64 bit machine, the instructions in the MSDN are missing some crucial information:
All registrations in HKLM\Software need to be performed inside HKLM\Software\Wow6432Node

The full file to register a sample plugin looks like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceCodeControlProvider\InstalledSCCProviders]
"MSSCCI Sample"="Software\\Your Company\\Your Product"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Your Company]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Your Company\Your Product]
"SCCServerName"="MSSCCI Sample"
"SCCServerPath"="D:\\Temp\\SampleMSSCCI\\Debug\\SampleMSSCCI.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceCodeControlProvider]
"ProviderRegKey"="Software\\Your Company\\Your Product"

[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders]
"MSSCCI Sample"="Software\\Your Company\\Your Product"

[HKEY_LOCAL_MACHINE\SOFTWARE\Your Company]

[HKEY_LOCAL_MACHINE\SOFTWARE\Your Company\Your Product]
"SCCServerName"="MSSCCI Sample"
"SCCServerPath"="D:\\Temp\\SampleMSSCCI\\Debug\\SampleMSSCCI.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider]
"ProviderRegKey"="Software\\Your Company\\Your Product"

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\CurrentSourceControlProvider]
@="{53544C4D-FFD5-48A9-B04A-0700CCD31070}"
"ProviderRegKey"="Software\\Your Company\\Your Product"

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\SourceControl]
"WarnedOldMSSCCIProvider"=dword:00000500
"UseOldSCC"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0Exp\SourceControl]
"WarnedOldMSSCCIProvider"=dword:00000500
"UseOldSCC"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0Exp\CurrentSourceControlProvider]
@="{53544C4D-FFD5-48A9-B04A-0700CCD31070}"
"ProviderRegKey"="Software\\Your Company\\Your Product"

Setup a Virtual Machine With Ubuntu Server

Setting up a virtual machine with Ubuntu Server is very simple.

  1. Download VMware Player
  2. Download Ubuntu Server ISO. I downloaded Ubuntu Server 13.04.
  3. Create a new virtual machine using VMware Player:
    1. Select “Create A New Virtual Machine”
    2. Choose “Installer disc image file” and select the downloaded ISO. It should detect the Ubuntu version and offer “Easy Install”.
    3. Enter your name and the details of the initial user account
    4. Provide a name and location for the virtual machine
    5. Start installation

Install Xamarin in vs 2013 Preview 1

As far as I know, Xamarin hasn’t yet released an installer for Visual Studio 2013 Preview 1.
Until they do, you can follow these simple instructions:

  1. Install Xamarin in Visual Studio 2012
  2. Copy the files from c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Xamarin\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Xamarin\
  3. Copy the folders Android and ios from inside c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates\CSharp\
  4. Copy the folders Xamarin.Android and ios from c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\ to c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\
  5. Execute the following command from a command prompt with elevation: "c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /setup /nosetupvstemplates

That’s it. You should now have a fully functional Xamarin setup in VS 2013!

Unit-testing With AutoFixture, NCrunch and Global State

Trying to unit-test code that relies on global state can be a frustrating experience. Global state is shared among tests, making the tests no longer independent. This can lead to subtle bugs in the test suite, e.g. a scenario where tests seem to fail randomly when executed in bigger batches, but pass when executed alone. Tracking down - and eliminating - the state sharing can be both time consuming and frustrating.

A Fluent Repository: Immutability

It has been pointed out that the implementation of the Fluent Repository base class I showed in Part 2 has a big flaw:
You need a new instance of the repository for each query, because the base class is mutable and thus it appends the query conditions to the internally stored IQueryable<T>. That’s not obvious and in fact counter-intuitive and because of that, it is bad.

A Fluent Repository Implementation - Part 2

The last article showed a simple implementation of the Fluent Repository.

Now, if you have a lot of entities it makes sense to extract as much of the repeating code as possible into reusable code to make the actual query implementations to only contain the query logic.

A Fluent Repository Implementation - Part 1

Problem with classical implementations of the Repository pattern

After establishing that the Repository pattern is still the pattern of choice for separating the domain layer from the data access layer, I want to talk about a common problem when implementing it: Method explosion.