Visual studio VS 2015无法打开由CodeCoverage.exe生成的.coveragexml

Visual studio VS 2015无法打开由CodeCoverage.exe生成的.coveragexml,visual-studio,sonarqube,code-coverage,mstest,vstest,Visual Studio,Sonarqube,Code Coverage,Mstest,Vstest,我正在跟踪SonarQube的文档 对于我的项目,我能够生成测试覆盖率二进制文件SonarQubeTests.csproj.coverage Visual Studio可以毫无问题地打开此文件。我可以看到所有的细节 然后,当我尝试使用以下命令生成.coveragexml文件时 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" "

我正在跟踪SonarQube的文档

对于我的项目,我能够生成测试覆盖率二进制文件SonarQubeTests.csproj.coverage

Visual Studio可以毫无问题地打开此文件。我可以看到所有的细节

然后,当我尝试使用以下命令生成.coveragexml文件时

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" "analyze /output:C:\SonarQubeTests.csproj.coveragexml C:\SonarQubeTests.csproj.coverage"
它确实会生成.coveragexml文件,但当我尝试打开Visual Studio时,它会给出以下错误:

我可以打开这个文件与文本编辑器和内容似乎都很好。但Visual Studio 2015和sonarqube都不读取此文件

我错过了什么

另外,我还有Ms Test runner的runner设置,如下所示。 不确定这是否会产生影响

    <?xml version="1.0" encoding="utf-8"?>  
<RunSettings>  
  <!-- Configurations that affect the Test Framework -->  
  <RunConfiguration>  
    <MaxCpuCount>1</MaxCpuCount>  
    <!-- Path relative to solution directory -->  
    <ResultsDirectory>C:\</ResultsDirectory>  

    <!-- [x86] | x64    
      - You can also change it from menu Test, Test Settings, Default Processor Architecture -->  
    <TargetPlatform>x86</TargetPlatform>  

    <!-- Framework35 | [Framework40] | Framework45 -->  
    <TargetFrameworkVersion>Framework45</TargetFrameworkVersion>  

    <!-- Path to Test Adapters -->  
    <TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>  
  </RunConfiguration>  

  <!-- Configurations for data collectors -->  
  <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>  
              <Exclude>  
                <ModulePath>.*CPPUnitTestFramework.*</ModulePath>  
              </Exclude>  
            </ModulePaths>  

            <!-- We recommend you do not change the following values: -->  
            <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>  
            <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>  
            <CollectFromChildProcesses>True</CollectFromChildProcesses>  
            <CollectAspDotNet>False</CollectAspDotNet>  

          </CodeCoverage>  
        </Configuration>  
      </DataCollector>  

    </DataCollectors>  
  </DataCollectionRunSettings>  

  <!-- Parameters used by tests at runtime -->  
  <TestRunParameters>  
    <Parameter name="webAppUrl" value="http://localhost" />  
    <Parameter name="webAppUserName" value="Admin" />  
    <Parameter name="webAppPassword" value="Password" />  
  </TestRunParameters>  

  <!-- Adapter Specific sections -->  

  <!-- MSTest adapter -->  
  <MSTest>  
    <MapInconclusiveToFailed>True</MapInconclusiveToFailed>  
    <CaptureTraceOutput>false</CaptureTraceOutput>  
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>  
    <DeploymentEnabled>False</DeploymentEnabled>  
    <AssemblyResolution>  
      <Directory Path="D:\myfolder\bin\" includeSubDirectories="false"/>  
    </AssemblyResolution>  
  </MSTest>  

</RunSettings>

我认为可以使用vstest.console直接获得代码覆盖率。我们不确定VS是否可以打开由第三方工具生成的代码覆盖率。
我认为如果我们能够vstest.console来获得代码覆盖率将不会有问题。请尝试查看结果。

CodeCoverage.exe不是第三方。我正在使用它生成.coveragexml。我已经在使用vstest.console.exe生成.covagare文件。然后您可以直接将.coverage文件拖动到VS并将其导出到coverage XML文件中。请仔细阅读问题。我不想要手动过程,这是SonarQube过程的一个步骤,我尝试按照文档进行操作。如果无法使用SonarQube PeAccess打开文件,我认为此问题与SonarQube有关。