Visual Studio persists on using UnitTestFramework 10.0.0.0

I've got a solution with several projects in it. One of the projects includes additional Assert methods for unit testing. It references Microsoft.VisualStudio.QualityTools.UnitTestFramework 10.1.0.0 . It also includes other test projects, which reference both Microsoft's UnitTestFramework and my project with additional assert methods.

Whenever I restart visual studio and compile, I get the following warning:

Found conflicts between different versions of the same dependent assembly.

I have tried changing all the references to the UnitTestFramework to 10.1.0.0, but upon restarting Visual Studio seems to set them to 10.0.0.0 again. I have even tried changing the project file outside of Visual Studio, but upon opening the project in Visual Studio the references show the old version in the solution explorer again. When closing Visual Studio without doing any file modifications, it asks whether or not to save changes to the project files.

How do I prevent Visual Studio from changing the version of my referenced UnitTestFramework in my projects?


Had same problem. One of our developers was reorganizing assemblies and his VS for some unknown reason changed this:

<Choose>
  <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
    <ItemGroup>
      <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    </ItemGroup>
  </When>
  <Otherwise>
    <ItemGroup>
      <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
    </ItemGroup>
  </Otherwise>
</Choose>

into this:

<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Choose>
  <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
    <ItemGroup>
      <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    </ItemGroup>
  </When>
  <Otherwise />
</Choose>

The first line of which kept getting changed on everyone else's system (same symptoms as you).

Since we have no plans to support 3.5 anyway, I fixed it by removing the "Choose" section and simplifying into:

<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />

(removing the specific version altogether from the reference)

链接地址: http://www.djcxy.com/p/10572.html

上一篇: Wix 3.5按钮控制上的图标

下一篇: Visual Studio坚持使用UnitTestFramework 10.0.0.0