Unit testing 放在哪里';使用Legacyv2RuntimeActivationPolicy';对于内置TFS2012

Unit testing 放在哪里';使用Legacyv2RuntimeActivationPolicy';对于内置TFS2012,unit-testing,tfsbuild,Unit Testing,Tfsbuild,当我在本地时,在单元测试中获取错误: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information 解决办法是增加 <configuration> <startup useLegacyV2RuntimeActiva

当我在本地时,在单元测试中获取错误:

Mixed mode assembly is built against version 'v2.0.50727' of 
the runtime and cannot be loaded in the 4.0 runtime without 
additional configuration information
解决办法是增加

<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
   </startup>
</configuration>
这在我们的TFS2012构建服务器上仍然出错。我还向TFS2012上的文件添加了启动标记,但构建服务器报告了错误


如何在构建定义中的单元测试项目(使用VS2012和TFS2012的新单元测试框架)上使用此功能?

在TFS上运行此功能时遇到问题,您可以尝试以编程方式对其进行设置(例如使用)。虽然我不建议在生产性代码中使用它,但在涉及单元测试时,它应该已经足够了。

这是要更新的正确的.config。您是否遇到了其他错误?
c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config