[NuGet] Fix unused variable compiler warnings.
[NuGet] Fix invalid cast exception.

DotNetProject wrapper class introduced with unit tests was
incorrectly being cast to the wrong type.