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

Đang mở
#189 5 bình luận 0 reaction 1 người được giao Xem trên GitHub

@fhnaseer đang làm issue này rồi.

Từ ngày 7/10/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
C#
Star
125
Fork
17
Merge trung bình
1 giờ 17 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/codecoverage

Tất cả issue của microsoft/codecoverage

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.