【问题标题】:feature.cs file in Nunit Test Project is not created未创建 Nunit 测试项目中的 feature.cs 文件
【发布时间】:2020-04-02 22:08:34
【问题描述】:

我正在尝试在 Visual Studio 2019 的 NUnit .Net Core 项目中创建一个功能。每次我创建一个功能时,feature.cs 文件都不会自动生成,并告诉我找不到源文件。我在 .csproj 中有以下内容。我还尝试将 SpecFlowSingleFileGenerator 设置为 true,但它不起作用,我已将其设置为 False。我错过了什么?

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.1.95" />
    <PackageReference Include="nunit" Version="3.12.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
  </ItemGroup>

</Project>

【问题讨论】:

    标签: c# specflow


    【解决方案1】:

    我不确定是否理解问题。对我来说,您不必触摸 csproj 文件。 您是否尝试过在这个项目中创建一个新类?

    【讨论】:

      猜你喜欢
      • 2019-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      • 2011-03-27
      • 2010-10-26
      • 2021-07-28
      相关资源
      最近更新 更多