Azure 构建管道:dotnet 构建失败并显示:FileNotFoundException:无法加载文件或程序集'TechTalk.SpecFlow,版本=3.1.0.0

Azure build pipeline: dotnet build fails with: FileNotFoundException: Could not load file or assembly 'TechTalk.SpecFlow, Version=3.1.0.0

使用任务 dotnet build 的构建管道开始失败,因为构建引擎版本最近从 16.4.0+ 更改为 16.5.0+。

nuget 包 SpecFlow 依赖库 TechTalk.SpecFlow.

异常看起来像:

C:\Users\VssAdministrator\.nuget\packages\specflow.tools.msbuild.generation.1.89\build\SpecFlow.Tools.MsBuild.Generation.targets(93,5): Error MSB4018: The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load file or assembly 'TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41'. The system cannot find the file specified.

我所做的调查(没有帮助):

有什么想法吗?

这是一个 issue with .NET SDK 3.1.200

作为解决方法,您可以继续使用 .NET SDK 3.1.102,直到它得到修复(在 .NET SDK、SpecFlow 或两者中)。

附加信息:

https://github.com/SpecFlowOSS/SpecFlow/issues/1912 https://github.com/dotnet/core/issues/4404#issuecomment-599768237