Version number:
packages.config<PackageReference> tagsSpecFlow.Tools.MsBuild.Generation NuGet packageSpecFlowSingleFileGenerator custom toolEnable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings
I created a SpecFlow project and was wondering if there is a way to use Specflow.Tools.MSBuild.Generation.dll file to generate tests in test explorer. I was able to create feature file and step definitions using TechTalk.SpecFlow.dll file and I thought using the Specflow.Tools.MSBuild.Generation.dll file I would be able to generate tests in test explorer. Is there a way to generate specflow test in test explorer using only dlls?
Hi @adiljs,
because the SpecFlow.Tools.MsBuild.Generation package is utilizing MSBuild to generate code-behind files of the feature files, you need to build the test project to generate tests and see them in the Test Explorer window.
Furthermore, simply referencing SpecFlow.Tools.MsBuild.Generation.dll will not help you, because the MSBuild targets for code-behind generation are not in there, but in the .targets file in the NuGet package. Please use the aforementioned NuGet package instead.
Hope this helps, please report back on whether it fixed your issue.
Hi @david1995,
Just for clarity, I will need to have SpecFlow.Tools.MsBuild.Generation package installed on my project in order to build the test project to generate tests in Test Explorer. Is that correct? Because doing so resolved the issue.
@adiljs Yes, for SpecFlow 3 you will need the SpecFlow.Tools.MsBuild.Generation package.
It is also necessary, that you always use the NuGet packages and don't use the dlls as direct reference. We rely on NuGet features like automatic MSBuild imports.
@david1995 @SabotageAndi Thanks for the quick response. I will move forward with your recommendation.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@adiljs Yes, for SpecFlow 3 you will need the
SpecFlow.Tools.MsBuild.Generationpackage.It is also necessary, that you always use the NuGet packages and don't use the dlls as direct reference. We rely on NuGet features like automatic MSBuild imports.