title: VS2010 SP1 unit tests targeting 3.5 framework fail if using private accessor
body: <p>I converted a solution from VS2008 to VS2010 SP1, and changed the unit test project to target the 3.5 framework. Other than having to fix a few references in the unit test project, everything worked ok and the solution built successfully. Most of the tests run successfully, but there were a handful that failed. The ones that failed are using a private accessor. Personally, I'd rather just remove these tests since I don't think they're necessary, but as long as it reveals a potential bug in SP1, I thought I'd see if anyone could figure out a work-around.</p>
  
  <p>The error message that I receive when running the tests is "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."
  As best as I can tell, it appears that the private accessor assembly is being built by the 4.0 runtime (most likely via Microsoft.VisualStudio.QualityTools.UnitTestFramework), but since the 3.5 runtime is loaded by MSTest, the resulting error occurs.</p>
  
  <p>I tried changing the reference for Microsoft.VisualStudio.QualityTools.UnitTestFramework to specifically use version 9.0 (currently it is 10.1). This results in a compile time error which says that the private accessor assembly uses version 10.0 of Microsoft.VisualStudio.QualityTools.UnitTestFramework, which is higher than version 9.0.</p>
  
  <p>I've deleted the generated private accessor assembly and recreated it as well, and still have the same issue. It would seem that something is out of sync with VS2010 SP1 when the 3.5 framework is targeted in a unit test project.</p>
  
  <p>Here is the code for one of the unit tests (again, not a very valuable test, but that's not the point of the post...):</p>
  
  <pre><code>    [TestMethod()]
      public void GetNullableCharValue_DBNull_ReturnsNull_Test()
      {
          object value = DBNull.Value;
          Nullable&lt;char&gt; expected = null;
          Nullable&lt;char&gt; actual;
          actual = RepositoryBase_Accessor.GetNullableCharValue(value);
          Assert.AreEqual(expected, actual);
      }
  </code></pre>