Tuesday, January 26, 2010

TypeCode enumeration for creating switch statements with

You can use the TypeCode enumeration to create switch statements for built-in types.

switch (Type.GetTypeCode(myObj.GetType())) {
    case TypeCode.Boolean: ...
    case TypeCode.Char: ...
    case TypeCode.String: ...
    case TypeCode.Object: ...
    default: ...

Monday, January 25, 2010

Visual Studio 2008 Test Results "Not Executed"

My unit tests were running fine and then for some reason the results started coming back as "Not Executed".

Trying to open the test to get more information only reports "The test has not been executed".

The problem persisted after a restart.

Clicking on the "Test run error" message in the yellow error reveals the issue.

Failed to queue test run 'dballinger@XXXXX 2010-01-25 13:51:40': Test Run deployment issue: The location of the file or directory 'd:\development\projectX\projectX.namespace\bin\debug\Ionic.Zip.dll' is not trusted.

Turns out a new third party DLL that I had added was marked as blocked when it came out of the zip file. More details here Stack Overflow: Why are all my Visual Studio test results “Not executed”

Microsoft Connect requests to add native .ZIP support to the .NET framework

  1. Add decent ZIP support to .NET by Joannes Vermorel - MVS
  2. .NET Framework 4.0 needs zip compression/extracting class which has compatibility with Windows zip folders.

In the mean time try: