Additional Steps for enabling re-targeting of Test Projects to .Net Framework 3.5 in VS 2010 SP1 Beta


Visual Studio 2010 Service Pack 1 enables basic support for unit
tests that target .Net framework 3.5.  If
the devenv.exe.config file has been modified by the user before applying this
Service Pack, then additional steps are required to enable the feature. (This
can typically happen if you have installed Visual Studio add-ons/plugins that have
modified the devenv.exe.config file. The Service Pack setup does not overwrite
the config file if it has been modified, hence
these additional steps are required)

If the devenv.exe.config file is not updated, the user will
see the following message when attempting to re-target .Net framework for a
Test Project to 3.5 in VS 2010 SP1


If the devenv.exe.config file is not updated, the user will
see the following message when opening a Visual Studio 2010 Test Project that
was targeted .Net Framework 3.5 via another installation of Visual Studio 2010


The following are the additional steps that are required to enable re-targeting of Test Projects to .Net Framework 3.5:

Close all running instances of Visual Studio

Open Visual Studio Command Prompt as an

cd to  “%programfiles%\Microsoft
Visual Studio 10.0\Common7\IDE” on a 32 bit OS or “%programfiles(x86)%\Microsoft
Visual Studio 10.0\Common7\IDE” on a 64 bit OS

Open devenv.exe.config file in a text
editor  (e.g. notepad.exe)

Add the following entries under  <assemblyBinding>



<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.UnitTestFramework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="" newVersion=""/>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="" newVersion=""/>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="" newVersion=""/>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="" newVersion=""/>


Add the following  entry under <configuration> Node


key=”TestProjectRetargetTo35Allowed” value=”true” />


Save the devenv.exe.config file

Repeat the steps with mstest.exe.config if it
has been modified before applying the Service Pack

The following is a sample showing how the file
should look after the above updates



Restart Visual Studio IDE, re-targeting of .Net
framework for a Test Project to 3.5 should now succeed.



Comments (12)

  1. Rohan Cragg says:

    Is this still applicable to SP1 RTM? The error message still directs the user to THIS page…

  2. Andy Yang says:

    I'm noticing weird behaviour.  Can anyone reproduce this?

    When I change the target framework version, the conversion wizard runs and the report indicates that my *Tests.VSTS.csproj file has been converted, and that the project file was also backed up in a separate directory.

    However, when I check the test project, I see that it is still targeting .NET 4.0. However, the csproj file in the *backup* directory has a <TargetFrameworkVersion> of 3.5.

    Is this behaviour reversed for anyone else?

  3. Mike Junkin says:

    I have the productivity pack installed for VS 2010 and if I make these changes the dock well and solution navigator add-ins fail to initialize.  Then when I try and open a solution VS 2010 crashes.

  4. A Noyd says:

    "Restart Visual Studio IDE, re-targeting of .Net framework for a Test Project to 3.5 should now succeed." Except it doesn't – it just sets the target framework straight back to 4.0 whether you run the wizard or not.

  5. I tried it with SP1 and  it works.

    If you have a problem on VS startup(crash)  it' certainly because you have a problem in  devenv.exe.config file structure.

    I have now a problem which test execution  "Impossible de convertir l'objet de type 'System.Runtime.Serialization.TypeLoadExceptionHolder' en type System.Collections.Generic.Dictionary`2[System.Uri,Microsoft.VisualStudio.TestTools.Common.AgentRuleDataCollector]" (Sorry it's in french – I've not the exact translation).

    A post has been posted on Microsoft connect :…/mstest-from-vs2010-sp1-beta1-cant-run-tests-for-3-5

  6. Keith says:

    How does this work?  The 10.1 assemblies are compiled against .NET 2.0 (cool) but when you run mstest.exe, the binding redirects cause the 10.0 assemblies (compiled against .NET 4) to be used.

  7. Peter Kellner says:

    I tried the above and it caused my visual studio 2010 sp1 (never installed a beta sp1) to open without any content.  Just titlebar.  luckily I made a backup copy of both files before I started.  (I would suggest you add that step to your instructions).

    any other suggestions?  (contact me at

    Peter Kellner

    Microsoft MVP, ASP.NET

  8. Jeff Stewart says:

    Not working for me, either, against SP1 proper.  Visual Studio crashes when trying to open a solution.

  9. Chris says:

    Same thing. It's broken. Definately not user error. I followed the above directions and now after I retarget the test it converts it immediately to .Net v4. Which is obviously not what anyone wants when they are retargeting to a lower version! 😉 Please fix this ASAP. This is also against SP1 RTM.

  10. After also having some trouble I found a solution working for me.

    For enabling re-targeting a test project to .net 3.5 the article states that one must add the <appSettings> tag under the <configuration> node in the devenv.exe.config file.

    The important part is: Do not add the <appSettings> tag above the <configSections> node!

    As long as the <configSections> node is NOT the first childnode of <configuration>, my Visual Studio pops up several error messages (like "The .NET Trace handling fails. Please check your .Net machine and enterprise configuration") and crashes if I try to open any solution.

    After I put the <appSettings> tag somewhere AFTER <configSections>, Visual Studio started up correctly and I could re-direct the test project to .net 3.5.

    I currently work with:

    Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel

    Microsoft .NET Framework Version 4.0.30319 SP1Rel

  11. Abhishek Agrawal [MSFT] says:


    Thanks for reporting the issues, we are investigating them and wil update back.



  12. Badajoz says:

    This works in the IDE but not for command line mstest… any ideas please (can't find anything on the net)