【发布时间】:2021-09-17 07:16:46
【问题描述】:
直到上个月,我们才能在 Azure Devops 构建管道中运行单元测试并将代码覆盖率发布到 sonarqube。现在我们在 .NET 代码的 Visual Studio 测试任务中遇到以下错误。
测试运行将使用为框架构建的 DLL .NETFramework,Version=v4.0 和平台 X86。以下 DLL(s) 不 匹配框架/平台设置。 MedicareActual.Api.Tests.dll 是 为 Framework 3.1 和平台 AnyCPU 构建。 Microsoft.AspNetCore.TestHost.dll 专为 Framework 3.1 和 平台 AnyCPU。 Microsoft.TestPlatform.CommunicationUtilities.dll 是 为 Framework 1.4 和平台 AnyCPU 构建。 Microsoft.TestPlatform.CoreUtilities.dll 是为 Framework 1.4 构建的 和平台 AnyCPU。 Microsoft.TestPlatform.CrossPlatEngine.dll 是 为 Framework 1.4 和平台 AnyCPU 构建。 Microsoft.TestPlatform.PlatformAbstractions.dll 是为框架构建的 1.0 和平台 AnyCPU。 Microsoft.VisualStudio.TestPlatform.Common.dll 是为框架构建的 1.4 和平台 AnyCPU。 Microsoft.VisualStudio.TestPlatform.ObjectModel.dll 专为 框架 1.4 和平台 AnyCPU。 testhost.dll 是为框架构建的 1.0 和平台 AnyCPU。
我们已尝试使用测试文件中的上述特定 .dll 覆盖测试运行参数/其他控制台选项。但没用。
【问题讨论】:
标签: .net dll azure-devops azure-pipelines vstest.console.exe