Error MSB4018 when referencing generator plug-in and building with dotnet build
My Visual Studio solution has two projects:
- project which implements a SpecFlow generator plug-in
- example project to use the SpecFlow generator plug-in (see below)
<ItemGroup>
<SpecFlowGeneratorPlugins Include="..\Output\net471\Com.<...>.SFP.<...>.SpecFlow.3.9.SpecFlowPlugin.dll" />
</ItemGroup>
Both projects target net471 and netcoreapp2.1.
Building in Visual Studio 2022 succeeds, but when building from the command line with dotnet build results in the following error:
SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: The "GenerateFeatureFileCodeBehindTask" task f
ailed unexpectedly.
What could be the reason why buiding with dotnet fails?
0
-
Replacing SpecFlow.NUnit by SpecFlow solves the issue, but then it is not possible anymore to run unit tests because SpecFlow.NUnit is required. Is there any dependency between SpecFlow.Tools.MSBuild.Generation and SpecFlow.NUnit which causes the build error?
<ItemGroup> <PackageReference Include="nunit" Version="3.13.2" /> <PackageReference Include="NUnit3TestAdapter" Version="3.14.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" /> <PackageReference Include="SpecFlow.NUnit" Version="3.9.58" /> </ItemGroup>
0
Please sign in to leave a comment.
Comments
1 comment