Fix build when NET4_0 symbol is defined

The build was broken when the NET4_0 symbol was defined: there was
a typo in a variable name and a couple of using statements were
missing.
Merge pull request #15 from jneill/fix/dotnet4-build

Fix build when NET4_0 symbol is defined