Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

935
Visualizações
dotnet test is unable to find a datacollector with friendly name 'Code Coverage'

A few months ago, when our projects were still in .NET 4.7.2, we used to run unit tests on our Azure DevOps Server using the Visual Studio Test task. We used parameter Test files to specify which test assemblies need to run and Code Coverage worked just fine there.

Since we migrated our projects to .NET 5.0, we use dotnet test to run unit tests and now Code Coverage doesn't work anymore.

Here's an example:

D:\test-2-1\_tool\dotnet\dotnet.exe test A.Test.dll B.Test.dll C.Test.dll --logger trx --results-directory D:\test-2-1\_temp --settings D:\test-2-1\5\s\.runsettings
Microsoft (R) Test Execution Command Line Tool Version 16.9.4
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 22 test files matched the specified pattern.
Data collection : Unable to find a datacollector with friendly name 'Code Coverage'.
Data collection : Could not find data collector 'Code Coverage'

Content of .runsettings

<DataCollectionRunSettings>
    <DataCollectors>
        <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
            <Configuration>
                <CodeCoverage>
                    <ModulePaths>
                        <Include>
                            <ModulePath>{someRegexToLimitCodeCoverageToSpecificTestAssemblies}</ModulePath>
                        </Include>
                    </ModulePaths>
                </CodeCoverage>
            </Configuration>
        </DataCollector>
    </DataCollectors>
</DataCollectionRunSettings>

In another smaller project, Code Coverage still works, but here we specify which project files should be tested, rather than which compiled test assemblies.

Is this the way to go now and if yes, is it possible to get it back to work with specifying test assemblies too?

Thanks in advance!

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda