我们已将项目从.NET移植到.NET Core,以便将AWS管道与需要Linux的Docker容器一起使用。
该应用程序在我们的本地计算机(运行Windows)上成功构建,但是在AWS管道中,构建步骤显示此错误-GenerateFeatureFileCodeBehindTask ... task could not be loaded from the assembly ... SpecFlow.Tools.MsBuild.Generation.dll
:
完整错误:
/root/.nuget/packages/specflow.tools.msbuild.generation/3.0.225/build/SpecFlow.Tools.MsBuild.Generation.targets(78,5): error MSB4062: The "SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask" task could not be loaded from the assembly /root/.nuget/packages/specflow.tools.msbuild.generation/3.0.225/build/../tasks/netcoreapp2.0/SpecFlow.Tools.MsBuild.Generation.dll. Assembly with same name is already loaded Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements
Microsoft.Build.Framework.ITask. [/codebuild/output/src814/src/s3/00/ProjectFoo/ProjectFoo.csproj]
我发现2个链接提到了此错误,但没有解决方案-https://ci.appveyor.com/project/SpecFlow/specflow-kx1o3/build/build1119和https://www.gitmemory.com/issue/techtalk/SpecFlow/1699/520196304。
我已检查并且csproj文件中没有<UsingTask>
。知道这个SpecFlow任务是什么,为什么会引发此错误?
答案 0 :(得分:1)
GenerateFeatureFileCodeBehindTask
包含在SpecFlow.Tools.MSBuild.Generation
包中。它用于生成功能文件的代码隐藏文件。
您找不到<UsingTask>
,因为它是在NuGet包中完成的。
对此的GitHub问题是:https://github.com/techtalk/SpecFlow/issues/1699/ 目前,我不知道为什么会引发此错误。但是我们目前正在修复针对Linux的构建/测试。