仅安装Specflow.MSTest软件包时,Specflow 3.0会错误地生成NUnit测试

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了仅安装Specflow.MSTest软件包时,Specflow 3.0会错误地生成NUnit测试相关的知识,希望对你有一定的参考价值。

Specflow在将MSTest指定为单元测试提供程序时,在引用NUnit测试属性的文件后面生成代码

// ------------------------------------------------------------------------------
//  <auto-generated>
//      This code was generated by SpecFlow (http://www.specflow.org/).
//      SpecFlow Version:3.0.0.0
//      SpecFlow Generator Version:3.0.0.0
// 
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace Microsoft.Azure.OneIM.Service.AcceptanceTests.Features.OutageAlertRuleManagement
{
    using TechTalk.SpecFlow;


    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.0.0.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [NUnit.Framework.TestFixtureAttribute()]
    [NUnit.Framework.DescriptionAttribute("Outage Alert Rule Management")]
    public partial class OutageAlertRuleManagementFeature
    {

        private TechTalk.SpecFlow.ITestRunner testRunner;
    ...

我通过浏览this documentation将我们相对较早的数据规格流程版本更新为3.0。>

我们使用MsTest,因此按照指定的指示,我安装了Specflow.MSTest软件包。这是我们的package.json

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="BoDi" version="1.4.1" targetFramework="net461" />
  <package id="Bond.Core.CSharp" version="5.0.0" targetFramework="net461" />
  <package id="Bond.CSharp" version="5.0.0" targetFramework="net461" />
  <package id="Bond.Runtime.CSharp" version="5.0.0" targetFramework="net461" />
  <package id="Dapper" version="1.50.2" targetFramework="net451" />
  <package id="DsmsCredentialsManagement" version="2.16.843" targetFramework="net461" />
  <package id="EnterpriseLibrary.TransientFaultHandling" version="6.0.1304.0" targetFramework="net451" />
  <package id="EnterpriseLibrary.TransientFaultHandling.WindowsAzure.Storage" version="6.0.1304.1" targetFramework="net451" />
  <package id="EntityFramework" version="6.1.3" targetFramework="net452" />
  <package id="Gherkin" version="6.0.0" targetFramework="net461" />
  <package id="libphonenumber-csharp" version="7.0.9" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
  <package id="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="1.1.0" targetFramework="net451" />
  <package id="Microsoft.Cloud.InstrumentationFramework" version="3.0.6.79" targetFramework="net461" />
  <package id="Microsoft.Team.Common.amd64" version="2.3.0.615" targetFramework="net461" />
  <package id="Microsoft.Team.Common.Web.amd64" version="2.4.0.529" targetFramework="net461" />
  <package id="Microsoft.Team.Diagnostics.amd64" version="2.4.0.529" targetFramework="net461" />
  <package id="Microsoft.Team.Storage" version="1.2.0.216" targetFramework="net451" />
  <package id="Microsoft.Team.Storage.SqlServer" version="1.2.0.222" targetFramework="net461" />
  <package id="Microsoft.OData.Client" version="6.14.0" targetFramework="net451" />
  <package id="Microsoft.OData.Core" version="6.14.0" targetFramework="net451" />
  <package id="Microsoft.OData.Edm" version="6.14.0" targetFramework="net451" />
  <package id="Microsoft.ServiceFabric" version="5.6.220" targetFramework="net451" />
  <package id="Microsoft.ServiceFabric.Data" version="2.6.220" targetFramework="net451" />
  <package id="Microsoft.ServiceFabric.Services" version="2.6.220" targetFramework="net451" />
  <package id="Microsoft.Spatial" version="6.14.0" targetFramework="net451" />
  <package id="Moq" version="4.2.1409.1722" targetFramework="net451" />
  <package id="MS.Team.Storage.TestLibrary" version="1.2.0.222" targetFramework="net461" />
  <package id="MSTest.TestFramework" version="1.4.0" targetFramework="net461" />
  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
  <package id="SpecFlow" version="3.0.225" targetFramework="net461" />
  <package id="SpecFlow.MsTest" version="3.0.225" targetFramework="net461" />
  <package id="SpecFlow.Tools.MsBuild.Generation" version="3.0.225" targetFramework="net461" />
  <package id="System.Reflection.Emit" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks.Extensions" version="4.4.0" targetFramework="net461" />
  <package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
  <package id="Unity" version="3.5.1404.0" targetFramework="net452" />
  <package id="Unity.Interception" version="3.5.1404.0" targetFramework="net452" />
  <package id="Utf8Json" version="1.3.7" targetFramework="net461" />
</packages>

这是完整的csproj:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.props" Condition="Exists('$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.props')" />
  <Import Project="$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.props" Condition="Exists('$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.props')" />
  <Import Project="$(PkgBond_CSharp)uildBond.CSharp.props" Condition="Exists('$(PkgBond_CSharp)uildBond.CSharp.props')" />
  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., root.props))
oot.props" />
  <PropertyGroup>
    <ProjectGuid>{36D3E255-D478-42E6-B50F-CBAECCFF2C81}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Microsoft.Azure.OneIM.Service.AcceptanceTests</RootNamespace>
    <AssemblyName>Microsoft.Azure.OneIM.Service.AcceptanceTests</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <TargetFrameworkProfile />
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="$(PkgBond_Core_CSharp)lib
et45Bond.dll">
      <Private>True</Private>
      <Name>Bond</Name>
    </Reference>
    <Reference Include="$(PkgBond_Core_CSharp)lib
et45Bond.Attributes.dll">
      <Private>True</Private>
      <Name>Bond.Attributes</Name>
    </Reference>
    <Reference Include="$(PkgBond_Core_CSharp)lib
et45Bond.IO.dll">
      <Private>True</Private>
      <Name>Bond.IO</Name>
    </Reference>
    <Reference Include="$(PkgBond_Runtime_CSharp)lib
et45Bond.JSON.dll">
      <Private>True</Private>
      <Name>Bond.JSON</Name>
    </Reference>
    <Reference Include="$(PkgDapper)lib
et45Dapper.dll">
      <Name>Dapper</Name>
    </Reference>
    <Reference Include="$(PkgEntityFramework)lib
et45EntityFramework.dll">
      <Name>EntityFramework</Name>
    </Reference>
    <Reference Include="$(PkgEntityFramework)lib
et45EntityFramework.SqlServer.dll">
      <Name>EntityFramework.SqlServer</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Azure_SqlDatabase_ElasticScale_Client)lib
et45Microsoft.Azure.SqlDatabase.ElasticScale.Client.dll">
      <Name>Microsoft.Azure.SqlDatabase.ElasticScale.Client</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Storage)lib
et45Microsoft.Team.Storage.dll">
      <Name>Microsoft.Team.Storage</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_OData_Client)lib
et40Microsoft.OData.Client.dll">
      <Name>Microsoft.OData.Client</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_OData_Core)libportable-net40+sl5+wp8+win8+wpaMicrosoft.OData.Core.dll">
      <Name>Microsoft.OData.Core</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_OData_Edm)libportable-net40+sl5+wp8+win8+wpaMicrosoft.OData.Edm.dll">
      <Name>Microsoft.OData.Edm</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_OneIM_Common_WinFabHost)lib
et45Microsoft.OneIM.Common.WinFabHost.exe">
      <Name>Microsoft.OneIM.Common.WinFabHost</Name>
    </Reference>
    <Reference Include="$(PkgEnterpriseLibrary_TransientFaultHandling)libportable-net45+win+wp8Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.dll">
      <Name>Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling</Name>
    </Reference>
    <Reference Include="$(PkgEnterpriseLibrary_TransientFaultHandling_WindowsAzure_Storage)libNET45Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.WindowsAzure.Storage.dll">
      <Name>Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.WindowsAzure.Storage</Name>
    </Reference>
    <Reference Include="$(PkgUnity)lib
et45Microsoft.Practices.Unity.dll">
      <Name>Microsoft.Practices.Unity</Name>
    </Reference>
    <Reference Include="$(PkgUnity)lib
et45Microsoft.Practices.Unity.Configuration.dll">
      <Name>Microsoft.Practices.Unity.Configuration</Name>
    </Reference>
    <Reference Include="$(PkgUnity_Interception)libNet45Microsoft.Practices.Unity.Interception.dll">
      <Name>Microsoft.Practices.Unity.Interception</Name>
    </Reference>
    <Reference Include="$(PkgUnity_Interception)libNet45Microsoft.Practices.Unity.Interception.Configuration.dll">
      <Name>Microsoft.Practices.Unity.Interception.Configuration</Name>
    </Reference>
    <Reference Include="$(PkgUnity)lib
et45Microsoft.Practices.Unity.RegistrationByConvention.dll">
      <Name>Microsoft.Practices.Unity.RegistrationByConvention</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric_Data)lib
et45Microsoft.ServiceFabric.Data.dll">
      <Name>Microsoft.ServiceFabric.Data</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric_Data)lib
et45Microsoft.ServiceFabric.Data.Interfaces.dll">
      <Name>Microsoft.ServiceFabric.Data.Interfaces</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45Microsoft.ServiceFabric.Internal.dll">
      <Name>Microsoft.ServiceFabric.Internal</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45Microsoft.ServiceFabric.Internal.Strings.dll">
      <Name>Microsoft.ServiceFabric.Internal.Strings</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric_Services)lib
et45Microsoft.ServiceFabric.Services.dll">
      <Name>Microsoft.ServiceFabric.Services</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Spatial)libportable-net40+sl5+wp8+win8+wpaMicrosoft.Spatial.dll">
      <Name>Microsoft.Spatial</Name>
    </Reference>
    <Reference Include="$(PkgMoq)lib
et40Moq.dll">
      <Name>Moq</Name>
    </Reference>
    <Reference Include="$(Pkglibphonenumber_csharp)libPhoneNumbers.dll">
      <Name>PhoneNumbers</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45System.Fabric.dll">
      <Name>System.Fabric</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45System.Fabric.Management.ServiceModel.dll">
      <Name>System.Fabric.Management.ServiceModel</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45System.Fabric.Management.ServiceModel.XmlSerializers.dll">
      <Name>System.Fabric.Management.ServiceModel.XmlSerializers</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_ServiceFabric)lib
et45System.Fabric.Strings.dll">
      <Name>System.Fabric.Strings</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_AspNet_WebApi_Client)lib
et45System.Net.Http.Formatting.dll">
      <Name>System.Net.Http.Formatting</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_AspNet_WebApi_Core)lib
et45System.Web.Http.dll">
      <Name>System.Web.Http</Name>
    </Reference>
    <Reference Include="$(PkgBoDi)lib
et45BoDi.dll">
      <Name>BoDi</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Cloud_InstrumentationFramework)lib
et40Microsoft.Cloud.InstrumentationFramework.Events.dll">
      <Name>Microsoft.Cloud.InstrumentationFramework.Events</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Cloud_InstrumentationFramework)lib
et40Microsoft.Cloud.InstrumentationFramework.Health.dll">
      <Name>Microsoft.Cloud.InstrumentationFramework.Health</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Cloud_InstrumentationFramework)lib
et40Microsoft.Cloud.InstrumentationFramework.Metrics.dll">
      <Name>Microsoft.Cloud.InstrumentationFramework.Metrics</Name>
    </Reference>
    <Reference Include="$(PkgDsmsCredentialsManagement)lib
et40Microsoft.WindowsAzure.Security.CredentialsManagement.Client.dll">
      <Name>Microsoft.WindowsAzure.Security.CredentialsManagement.Client</Name>
    </Reference>
    <Reference Include="$(PkgDsmsCredentialsManagement)lib
et40Microsoft.WindowsAzure.Security.CredentialsManagement.StorageHelper.dll">
      <Name>Microsoft.WindowsAzure.Security.CredentialsManagement.StorageHelper</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Common_amd64)lib
et45Microsoft.Team.Common.dll">
      <Name>Microsoft.Team.Common</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Common_Web_amd64)lib
et45Microsoft.Team.Common.Web.dll">
      <Name>Microsoft.Team.Common.Web</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Diagnostics_amd64)lib
et45Microsoft.Team.Diagnostics.dll">
      <Name>Microsoft.Team.Diagnostics</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Storage_SqlServer)lib
et45Microsoft.Team.Storage.Implementation.dll">
      <Name>Microsoft.Team.Storage.Implementation</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Storage_SqlServer)lib
et45Microsoft.Team.Storage.SqlServer.dll">
      <Name>Microsoft.Team.Storage.SqlServer</Name>
    </Reference>
    <Reference Include="$(PkgMS_Team_Storage_TestLibrary)lib
et45MS.Team.Storage.TestLibrary.dll">
      <Name>MS.Team.Storage.TestLibrary</Name>
    </Reference>
    <Reference Include="$(PkgNewtonsoft_Json)lib
et45Newtonsoft.Json.dll">
      <Name>Newtonsoft.Json</Name>
    </Reference>
    <Reference Include="$(PkgGherkin)lib
et45Gherkin.dll">
      <Name>Gherkin</Name>
    </Reference>
    <Reference Include="$(PkgMicrosoft_Team_Rules_Domain)lib
et45Microsoft.Team.Rules.Domain.dll">
      <Name>Microsoft.Team.Rules.Domain</Name>
    </Reference>
    <Reference Include="$(PkgMSTest_TestFramework)lib
et45Microsoft.VisualStudio.TestPlatform.TestFramework.dll">
      <Name>Microsoft.VisualStudio.TestPlatform.TestFramework</Name>
    </Reference>
    <Reference Include="$(PkgMSTest_TestFramework)lib
et45Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll">
      <Name>Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions</Name>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="$(PkgSystem_Threading_Tasks_Extensions)lib
etstandard2.0System.Threading.Tasks.Extensions.dll">
      <Name>System.Threading.Tasks.Extensions</Name>
    </Reference>
    <Reference Include="$(PkgSystem_ValueTuple)lib
et461System.ValueTuple.dll">
      <Name>System.ValueTuple</Name>
    </Reference>
    <Reference Include="$(PkgSpecFlow)lib
et45TechTalk.SpecFlow.dll">
      <Name>TechTalk.SpecFlow</Name>
    </Reference>
    <Reference Include="$(PkgSpecFlow_MsTest)lib
et45TechTalk.SpecFlow.MSTest.SpecFlowPlugin.dll">
      <Name>TechTalk.SpecFlow.MSTest.SpecFlowPlugin</Name>
    </Reference>
    <Reference Include="$(PkgUtf8Json)lib
et45Utf8Json.dll">
      <HintPath>Utf8Json</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config">
      <SubType>Designer</SubType>
    </None>
    <None Include="FeaturesOutageAlertRuleManagementOutageAlertRuleManagement.feature" />
    <None Include="packages.config">
      <SubType>Designer</SubType>
    </None>
  </ItemGroup>
  <ItemGroup />
  <ItemGroup>
    <Compile Include="FeaturesOutageAlertRuleManagementOutageAlertRuleManagementSteps.cs" />
    <Compile Include="SetupBeforeTestRunHook.cs" />
    <Compile Include="SetupTestConstants.cs" />
    <Compile Include="SetupUnitySetup.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="....ProductService.BusinessService.Business.csproj">
      <Project>{9caf6690-e918-4d2a-99dd-2864cfd216a2}</Project>
      <Name>Service.Business</Name>
    </ProjectReference>
    <ProjectReference Include="....ProductService.CoreService.Core.csproj">
      <Project>{e1befc55-8b80-4c61-998b-c0d5cb6f4f9a}</Project>
      <Name>Service.Core</Name>
    </ProjectReference>
    <ProjectReference Include="....ProductService.ExternalService.External.csproj">
      <Project>{8c0eafa6-9ce7-4993-a42f-102d287e270f}</Project>
      <Name>Service.External</Name>
    </ProjectReference>
    <ProjectReference Include="....ProductService.ServiceService.Service.csproj">
      <Project>{d6aca221-5b31-4363-85f2-b7f745c30ba6}</Project>
      <Name>Service.Service</Name>
    </ProjectReference>
    <ProjectReference Include="....ProductService.StorageService.Storage.csproj">
      <Project>{e048ebcf-2363-4dd5-ade3-daeb7b396e24}</Project>
      <Name>Service.Storage</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <QCustomInput Include="$(PkgMsBuildShim_OneBranch)">
      <Visible>false</Visible>
    </QCustomInput>
    <QCustomInput Include="$(PkgVisualStudio_StaticAnalysisTools_Corext)">
      <Visible>false</Visible>
    </QCustomInput>
  </ItemGroup>
  <ItemGroup>
    <Content Include="$(PkgDsmsCredentialsManagement)libNativeManagedCertStore.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="$(PkgDsmsCredentialsManagement)libNativeSecretsPackage.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
    <Content Include="$(PkgDsmsCredentialsManagement)libNativeCMClientLib.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(ExtendedTargetsPath)Microsoft.CSharp.targets" />
  <Import Project="$(PkgBond_CSharp)uildBond.CSharp.props" Condition="Exists('$(PkgBond_CSharp)uildBond.CSharp.props')" />
  <Import Project="$(PkgMicrosoft_Cloud_InstrumentationFramework)uildMicrosoft.Cloud.InstrumentationFramework.targets" Condition="Exists('$(PkgMicrosoft_Cloud_InstrumentationFramework)uildMicrosoft.Cloud.InstrumentationFramework.targets')" />
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('$(PkgMicrosoft_Cloud_InstrumentationFramework)uildMicrosoft.Cloud.InstrumentationFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgMicrosoft_Cloud_InstrumentationFramework)uildMicrosoft.Cloud.InstrumentationFramework.targets'))" />
    <Error Condition="!Exists('$(PkgBond_CSharp)uildBond.CSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgBond_CSharp)uildBond.CSharp.props'))" />
    <Error Condition="!Exists('$(PkgBond_CSharp)uildBond.CSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgBond_CSharp)uildBond.CSharp.targets'))" />
    <Error Condition="!Exists('$(PkgDsmsCredentialsManagement)uildDsmsCredentialsManagement.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgDsmsCredentialsManagement)uildDsmsCredentialsManagement.targets'))" />
    <Error Condition="!Exists('$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.props')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.props'))" />
    <Error Condition="!Exists('$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.targets'))" />
    <Error Condition="!Exists('$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.props')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.props'))" />
    <Error Condition="!Exists('$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.targets'))" />
  </Target>
  <Import Project="$(PkgBond_CSharp)uildBond.CSharp.targets" Condition="Exists('$(PkgBond_CSharp)uildBond.CSharp.targets')" />
  <Import Project="$(PkgDsmsCredentialsManagement)uildDsmsCredentialsManagement.targets" Condition="Exists('$(PkgDsmsCredentialsManagement)uildDsmsCredentialsManagement.targets')" />
  <Import Project="$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.targets" Condition="Exists('$(PkgSpecFlow_Tools_MsBuild_Generation)uildSpecFlow.Tools.MsBuild.Generation.targets')" />
  <Import Project="$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.targets" Condition="Exists('$(PkgSpecFlow_MsTest)uildSpecFlow.MsTest.targets')" />
  <Target Name="AfterUpdateFeatureFilesInProject">
    <!-- include any generated SpecFlow files in the compilation of the project if not included yet -->
    <ItemGroup>
      <Compile Include="***.feature.cs" Exclude="@(Compile)" />
    </ItemGroup>
  </Target>
</Project>

而且我还确保在功能文件上也清除了“自定义工具”字段。

非常不确定如何进行此处。根据他们的文档,您可以根据安装的测试提供程序包在Specflow 3中指定测试提供程序。

Specflow在将MSTest指定为单元测试提供者时//在引用NUnit测试属性的文件后面生成代码// --------------------------- --------------------------------------------...

答案

我的情况是在App.config文件中添加以下内容:

  <specFlow>
    <unitTestProvider name="xUnit" />
    <generator allowDebugGeneratedFiles="true" />
  </specFlow>

以上是关于仅安装Specflow.MSTest软件包时,Specflow 3.0会错误地生成NUnit测试的主要内容,如果未能解决你的问题,请参考以下文章

什么是sp_attach_db过程

deepin15.5sp2专业版怎么安装软件

Oracle SP 和触发器仅成功运行一次

sdl trados不是自动翻译软件吗

安装SQL2008时点击SETUP后不出现安装界面

Envi风暴Envi 5.3 SP1经典安装手把手图文教程(含补丁文件)