Skip to content

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

@MarkVecozo

Description

@MarkVecozo

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions