Visual Studio does not work when using UnitTestFramework 10.0.0.0

I have a solution with several projects. One project includes additional Assert methods for unit testing. It refers to Microsoft.VisualStudio.QualityTools.UnitTestFramework 10.1.0.0 . It also includes other test projects that reference both Microsoft UnitTestFramework and my project using additional assert methods.

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

Conflicts were found between different versions of the same dependent assembly.

I tried changing all references to UnitTestFramework to 10.1.0.0, but when restarting Visual Studio seems to set them to 10.0.0.0 again. I even tried to modify the project file outside of Visual Studio, but after opening the project in Visual Studio, the links again show the old version in Solution Explorer. When you close Visual Studio without any file modifications, it asks if the changes to the project files should be saved or not.

How do I prevent Visual Studio from modifying my version of UnitTestFramework in my projects?

+10
source share
2 answers

There was the 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> 

in it:

 <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 has been changed to all other systems (the same symptoms as you).

Since in any case we do not plan to support 3.5, I fixed it by deleting the "Select" section and simplifying it:

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

(removing a specific version from a link)

+4
source

In my case, in VS2017 + Resharper, I deleted the link to v 10.0.0.0 and again added the link to 10.1.0.0. A simple reassignment of the link in the link browser did not work, and, oddly enough, it did not undo the changes in my Tests.csproj file in the version control system.

0
source

All Articles