相关疑难解决方法(0)

xUnit 测试在本地运行,但不在 Azure DevOps 上运行

我的 xUnit 测试在本地运行良好,但无法在 Azure DevOps 上运行。受测试的程序集是 .NET 5.0 程序集,测试程序集也是如此。

检查 VsTest 任务的日志文件,我看到以下内容

测试运行检测到针对不同框架和平台版本构建的 DLL。以下 DLL 与当前设置不匹配,即 .NETFramework、Version=v5.0 框架和 X86 平台。

UnitTests.dll 是为 Framework .NETCoreApp、Version=v5.0 和 Platform AnyCPU 构建的。

Microsoft.TestPlatform.CommunicationUtilities.dll 是为 Framework .NETStandard、Version=v2.0 和 Platform AnyCPU 构建的。

Microsoft.TestPlatform.CoreUtilities.dll 是为 Framework .NETStandard、Version=v2.0 和 Platform AnyCPU 构建的。

Microsoft.TestPlatform.CrossPlatEngine.dll 是为 Framework .NETStandard、Version=v2.0 和 Platform AnyCPU 构建的。

Microsoft.TestPlatform.PlatformAbstractions.dll 是为 Framework .NETCoreApp、Version=v2.1 和 Platform AnyCPU 构建的。

Microsoft.TestPlatform.Utilities.dll 是为 Framework .NETStandard、Version=v2.0 和 Platform AnyCPU 构建的。

Microsoft.VisualStudio.TestPlatform.Common.dll 是为 Framework .NETStandard、Version=v2.0 和 Platform AnyCPU 构建的。

Microsoft.VisualStudio.TestPlatform.ObjectModel.dll 是为 Framework .NETStandard、Version=v2.0 …

xunit build-pipeline vstest azure-devops

6
推荐指数
1
解决办法
2298
查看次数

标签 统计

azure-devops ×1

build-pipeline ×1

vstest ×1

xunit ×1