Gen背后的SpecFlow / MSBuild代码-生成所有任务

问题描述 投票:1回答:1

在我正在从事的项目中,我维护着一些用SpecFlow编写的功能测试。我们的团队大约在一年前开始使用Visual Studio 2017,我们最终进行一些维护!

我们正在研究的项目的测试最初是用SpecFlow 2.3.2编写的,最后在Visual Studio 2015中进行了更新。

SpecFlowSingleFileGenerator不能在VS 2017上运行,所以昨天我花了大部分时间将套件更改为使用MSBuildSingleFileGenerator,如this article in SpecFlow's official documentation中所述>

问题:

在本地,我可以构建我的解决方案,包括功能测试项目。但是,当我尝试在构建服务器上构建项目时,仍然出现以下错误:
[exec]  C:\CheckoutDirectory\My Awesome Project\packages\SpecFlow.Tools.MsBuild.Generation.2.3.2\build\SpecFlow.Tools.MsBuild.Generation.targets(45,5): 
error MSB4036: The "GenerateAll" task was not found. 
Check the following: 
  1.) The name of the task in the project file is the same as the name of the task class. 
  2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 
  3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" directory. [C:\CheckoutDirectory\My Awesome Project\AwesomeProject.FeatureTest\AwesomeProject.FeatureTest.csproj]

我应该指出,我们的团队在编写MS Build任务方面具有no

经验,这是迄今为止我们所不需要的;我们在TeamCity上使用NAnt构建脚本来管理我们的构建工作。很明显,错误消息would会有所帮助...如果我们知道字面上的了解。

现在,通常正确的答案是:谷歌搜索。我did that,并且此特定错误没有相关结果。

此外,这阻碍了我的团队,因为我们需要构建工作。我没有时间进行必要的研究和教育,以正确了解MS Build技术的工作原理。那必须稍后再来。

问题:

请记住,SpecFlow破坏了我们的流程,并且我们的团队缺乏有关MS Build系统的知识:我需要知道如何解决"GenerateAll" task was not found错误。我该如何解决?

次级问题:

我也乐于接受横向思考。有什么方法可以破解VS 2017或SpecFlow,以使SpecFlowSingleFileGenerator彼此“兼容”吗?这里的目标是NOT避免进行更改,但要控制更改。我需要一条从旧文件生成器过渡到MS构建生成系统的路径。

其他信息:

因此,我做了一些挖掘,发现在SpecFlow.Tools.MsBuild.Generation.targets文件中调用“ GenerateAll”的地方:
<Target Name="UpdateFeatureFilesInProject"  
        DependsOnTargets="BeforeUpdateFeatureFilesInProject"  
        Inputs="@(SpecFlowFeatureFiles)" Outputs="@(SpecFlowFeatureFiles->'%(RelativeDir)\%(Filename).feature.cs')">
  <GenerateAll
    ShowTrace="$(ShowTrace)"

    BuildServerMode="$(BuildServerMode)"
    OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"

    ProjectPath="$(MSBuildProjectFullPath)"
    ForceGeneration="$(ForceGeneration)"
    VerboseOutput="$(VerboseOutput)"
    DebugTask="$(SpecFlow_DebugMSBuildTask)" 
    >
    <Output TaskParameter="GeneratedFiles" ItemName="SpecFlowGeneratedFiles" />
  </GenerateAll>
</Target>

因为我已经[[确认]]将其复制到构建服务器,所以情况更加神秘。看来NuGet软件包已被忠实地拉下来。因此,我无法弄清楚为什么我的本地副本与构建服务器上的副本行为不同。

在我正在从事的项目中,我维护着一些用SpecFlow编写的功能测试。我们的团队大约在一年前开始使用Visual Studio 2017,我们终于开始对...
visual-studio-2017 teamcity specflow msbuild-task
1个回答
2
投票
我不确定您在哪里找到此声明:

[已知SpecFlowSingleFileGenerator在VS 2017上不起作用
© www.soinside.com 2019 - 2024. All rights reserved.