locked
could not load file or assembly 'microsoft.visualstudio.qualitytools.unittestframework RRS feed

  • Question

  • Help please, I've been stuck on this for hours, I'm trying to build my solution and I'm getting this error could not load file or assembly 'microsoft.visualstudio.qualitytools.unittestframework, Versin=10.0.0......' The "BuildShadowTask" failed unexpectedly. I'm using visual studio 2017, and project is targeting .NET Framework 6.1

    I've tried reinstalling MSTest.TestFramewok and MSTest.TestAdapter and makes no difference.

    Monday, February 4, 2019 3:30 PM

All replies

  • Hi friend,

    Welcome to MSDN forum.

    If we create a new Test project in VS2017 and does this issue persists or not?

    I’m wondering if the project you build comes from an older version of vs. Because in VS2017, the default reference of unit test project is “Microsoft.VisualStudio.TestPlatform.TestFramework” instead of “'microsoft.visualstudio.qualitytools.unittestframework”. So I think your project is developed in earlier versions, which may cause the .xxproj file format differs from that(new versions) created by VS2017. So if possible, could you share the xxproj file to us so that we can check it directly for you.

    And refer to the error message, please go to Reference-Assemblies-Extensions and check the assembly ‘Microsoft.VisualStudio.QualityTools.UnitTestFramework’ version is correct and make sure the required dll file also existing under your solution folder.

    Meanwhile, please have a look at this similar issue.

    If there has any update about it, please feel free to share it here. 

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, February 5, 2019 6:28 AM
  • Hi thanks for your reply, below is the content of the project file of one of the unit test failing
    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>
        </ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{A9D803FA-9F2D-43A0-81DB-06AA087685A4}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>BatchScanManagement.Test</RootNamespace>
        <AssemblyName>BatchScanManagement.Test</AssemblyName>
        <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <SccProjectName>SAK</SccProjectName>
        <SccLocalPath>SAK</SccLocalPath>
        <SccAuxPath>SAK</SccAuxPath>
        <SccProvider>SAK</SccProvider>
        <TargetFrameworkProfile />
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x86\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <DebugType>full</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <CodeAnalysisLogFile>bin\Debug\BatchScanManagement.Test.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
        <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
        <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
        <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
        <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
        <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
        <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
        <Prefer32Bit>false</Prefer32Bit>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
        <OutputPath>bin\x86\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <Optimize>true</Optimize>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <CodeAnalysisLogFile>bin\Release\BatchScanManagement.Test.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
        <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
        <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
        <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
        <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
        <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
        <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
        <Prefer32Bit>false</Prefer32Bit>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug CA|x86'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x86\Debug CA\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <DebugType>full</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <CodeAnalysisLogFile>bin\Debug\BatchScanManagement.Test.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
        <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
        <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
        <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
        <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
        <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
        <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
        <Prefer32Bit>false</Prefer32Bit>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="Interop.FREngine">
          <HintPath>..\..\..\3rd Party Files\Abbyy\Shippable\Bin\Interop.FREngine.dll</HintPath>
          <EmbedInteropTypes>False</EmbedInteropTypes>
        </Reference>
        <Reference Include="Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="mscorlib.4.0.0.0.Fakes">
          <HintPath>FakesAssemblies\mscorlib.4.0.0.0.Fakes.dll</HintPath>
        </Reference>
        <Reference Include="System" />
        <Reference Include="System.4.0.0.0.Fakes">
          <HintPath>FakesAssemblies\System.4.0.0.0.Fakes.dll</HintPath>
        </Reference>
        <Reference Include="System.Core">
          <RequiredTargetFramework>3.5</RequiredTargetFramework>
        </Reference>
        <Reference Include="System.Data" />
        <Reference Include="System.Data.DataSetExtensions" />
        <Reference Include="System.Xml" />
        <Reference Include="System.Xml.Linq" />
      </ItemGroup>
      <ItemGroup>
        <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
          <Visible>False</Visible>
        </CodeAnalysisDependentAssemblyPaths>
      </ItemGroup>
      <ItemGroup>
        <Compile Include="BatchScanManagerTest.cs" />
        <Compile Include="BatchScanTest.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
        <Compile Include="BatchScanSubmitToFolderTest.cs" />
      </ItemGroup>
      <ItemGroup>
        <ProjectReference Include="..\..\..\ZD Client\Utilities\Utilities.csproj">
          <Project>{A3A65454-4B5A-4EC2-8FAF-CE76E36C9665}</Project>
          <Name>Utilities</Name>
        </ProjectReference>
        <ProjectReference Include="..\..\..\xxxxx.Controllers\xxxxx.Controllers.csproj">
          <Project>{AADFF0F1-0163-4B57-88C1-212B0E204300}</Project>
          <Name>xxxxx.Controllers</Name>
        </ProjectReference>
        <ProjectReference Include="..\..\..\xxxxx.DataModel\xxxxx.DataModel.csproj">
          <Project>{B62B1841-295D-4A71-A644-8A582213E418}</Project>
          <Name>xxxxx.DataModel</Name>
        </ProjectReference>
        <ProjectReference Include="..\..\..\xxxxx.Exceptions\xxxxx.Exceptions.csproj">
          <Project>{AA35C6F3-6CC9-46C8-A782-C8F669426C16}</Project>
          <Name>xxxxx.Exceptions</Name>
        </ProjectReference>
        <ProjectReference Include="..\..\..\xxxxx.Mocks\xxxxx.Mocks.csproj">
          <Project>{2B9B4885-DD2F-45AE-BC82-BC724FF77A71}</Project>
          <Name>xxxxx.Mocks</Name>
        </ProjectReference>
        <ProjectReference Include="..\..\..\xxxxx.Utilities\xxxxx.Utilities.csproj">
          <Project>{6AD3DC70-61EA-4245-B026-CFED9D3A0CE5}</Project>
          <Name>xxxxx.Utilities</Name>
        </ProjectReference>
        <ProjectReference Include="..\BatchScanManager\BatchScanManagement.csproj">
          <Project>{8686AEC0-8F7D-427F-8BCC-37379E1C2EBF}</Project>
          <Name>BatchScanManagement</Name>
        </ProjectReference>
        <ProjectReference Include="..\DocumentConverter\DocumentConverter.csproj">
          <Project>{D93D630A-902B-4714-B3FD-2F43C4022C28}</Project>
          <Name>DocumentConverter</Name>
        </ProjectReference>
        <ProjectReference Include="..\DocumentSplitter\DocumentSplitter.csproj">
          <Project>{302036E4-36EA-403F-BDF1-A45D6CBA807E}</Project>
          <Name>DocumentSplitter</Name>
        </ProjectReference>
        <ProjectReference Include="..\PDFAnalyser\PDFAnalyser.csproj">
          <Project>{9E1B89B8-6173-4699-8863-80A92AD0E67B}</Project>
          <Name>PDFAnalyser</Name>
        </ProjectReference>
      </ItemGroup>
      <ItemGroup>
        <Fakes Include="Fakes\System.fakes" />
      </ItemGroup>
      <ItemGroup>
        <Fakes Include="Fakes\mscorlib.fakes" />
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
      <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
           Other similar extension points exist, see Microsoft.Common.targets.
      <Target Name="BeforeBuild">
      </Target>
      <Target Name="AfterBuild">
      </Target>
      -->
    </Project>

    Tuesday, February 5, 2019 2:23 PM
  • Hi friend,

    I can't reproduce this issue at my side for its complex situation. I have checked the csproj file, and it seems add some references to assembly from VS2010(code analyze 10.0) and build with the tool from VS2013(Toolversion=12.0) and now we open and build it in VS2017. 

    First please check if the reference in csproj file right exists in the location.

    Then remove the "microsoft.visualstudio.qualitytools.unittestframework" and re-add it again to make sure we add ref successfully.

    Also, make sure we have install build tools for vs2013

    In addition: I think you can get some help from this .

    As it seems several projects exist in your solution, so please check if there has references between these projects. (Project ref or assembly ref)

    When building solution, several projects are built together. So I wonder if one project cause such issue and other projects which depend on it fail duo to it. What's the result if we build project one by one instead of build solution to locate the error.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, February 6, 2019 6:28 AM