microsoft / microsoft/codecoverage

Method not found: 'Microsoft.CodeCoverage.Core.Configurations.DataCollectorConfiguration Microsoft.CodeCoverage.Core.Configurations.ConfigurationFileUtility.GetConfiguration(System.Xml.XmlElement, Microsoft.CodeCoverage.Core.ILogger)

Open
#189 5 comments 0 reactions 1 assignee View on GitHub

@fhnaseer is already working on this.

Since Oct 7, 2025.

Dominant language
C#
Stars
125
Forks
17
Avg merge
1h 17m
Merged PRs (30d)
2

Description

Describe the bug

We are updating some packages, and the upgrade for MsTest seems to break some tests in Azure Pipelines:

`Data collector 'Code Coverage' message: Data collector 'Code Coverage' threw an exception during type loading, construction, or initialization: System.MissingMethodException: Method not found: 'Microsoft.CodeCoverage.Core.Configurations.DataCollectorConfiguration Microsoft.CodeCoverage.Core.Configurations.ConfigurationFileUtility.GetConfiguration(System.Xml.XmlElement, Microsoft.CodeCoverage.Core.ILogger)'

Steps To Reproduce

Update MsTest package to v3.8.0 or beyond.
(It seems in this version the CodeCoverage is now a dependency of MSTest metapackage)

WIth .NET472 test projects there is no problem, with .NET8 test projects, we see this error in Azure Pipelines.

Expected behavior

Tests are run and succeed with no errors.

Actual behavior

Test are run and succeed, after we get an error on the Code Coverage.

Additional context

Command line:
D:\a\_tool\dotnet\dotnet.exe test D:\a\29\s\Project\Project.CITest\Project.CITest.csproj --logger trx --results-directory D:\a\_temp --configuration Release --arch x64 --logger trx --settings Project\default.runsettings

Stacktrace;
Data collector 'Code Coverage' message: Data collector 'Code Coverage' threw an exception during type loading, construction, or initialization: System.MissingMethodException: Method not found: 'Microsoft.CodeCoverage.Core.Configurations.DataCollectorConfiguration Microsoft.CodeCoverage.Core.Configurations.ConfigurationFileUtility.GetConfiguration(System.Xml.XmlElement, Microsoft.CodeCoverage.Core.ILogger)'. at Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector.OnInitialize(XmlElement configurationElement) at Microsoft.VisualStudio.TraceCollector.BaseDataCollector.Initialize(XmlElement configurationElement, IDataCollectionEvents events, IDataCollectionSink dataSink, IDataCollectionLogger logger, IDataCollectionAgentContext agentContext) at Microsoft.VisualStudio.TraceCollector.BaseDataCollector.Initialize(XmlElement configurationElement, DataCollectionEvents events, DataCollectionSink dataSink, DataCollectionLogger logger, DataCollectionEnvironmentContext environmentContext) at Microsoft.VisualStudio.TestPlatform.Common.DataCollector.DataCollectorInformation.InitializeDataCollector(ITelemetryReporter telemetryReporter) in /_/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectorInformation.cs:line 115 at Microsoft.VisualStudio.TestPlatform.Common.DataCollector.DataCollectionManager.LoadAndInitialize(DataCollectorSettings dataCollectorSettings, String settingsXml) in /_/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionManager.cs:line 537.. Results File: D:\a\_temp\AzDevOps_agent0009TN_2025-10-07_10_45_14.trx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.