Specflow: Generate Step Definition context menu option missing VS2013

Created on 19 Jul 2016  ·  15Comments  ·  Source: SpecFlowOSS/SpecFlow

I'm using VS2013, "Generate Step Definition” context menu option is also missing for me. I have added nuget packages for "Specflow" and "SpecFlow.MsTest". I've also added the Specflow Visual Studio Extension. I was able to select AddNew ItemSpecflow Feature File and my project compiles ok. The app.config looks ok, just has the defaults with MSTest set for UnitTestProvider name.

If I right-click the Scenario file, I am able to select "Run SepcFlow Scenarios" then copy the skeleton step definition from the exception message. However, life would be easier with the context menu option to generate step definitions.

Where did I go wrong?

genstepdef

VisualStudioIntegration

Most helpful comment

Right click in the file editor, to get the menu entry:
image

All 15 comments

Right click in the file editor, to get the menu entry:
image

Ahh, easy when you know how! Thanks

Can't find "generate Step Definiton" after right click on my feature file.

image

tried in the file too.

image

Is this issue still open? I see the same behaviour in VS 2017.

Have you isntalled the VS extension?

@Stephen-Mc

I ran into this same issue, and it required explicitly referencing the TechTalk.SpecFlow DLL, which wasn't auto-referenced by installing the NuGet package, nor with the Extension.

Edit: To be clear, I had to explicitly reference:

C:\Users\%UserProfile%\.nuget\packages\specflow\2.4.0\lib\net45\TechTalk.SpecFlow.dll

in my project in order for the context menu option to show up. This is with the VS extension installed, and SpecFlow NuGet package installed (as well as SpecFlow.NUnit, SpecFlow.XUnit, and SpecRun.Runner nuget packages installed)

This is an issue still. have got all the packages installed and still do not get the "Generate Step definition" menu context appearing.
TechTalk.SpecFlow.dll missing file reference is causing the issue. It is causing compilation issue as well.
This is such a waste of time.

@joshuakaling see my post above yours.

Add the DLL explicitly, then edit the ref in your project file manually to utilize an MSBuild macro to the global nuget package cache. IIRC it's something like $(nugetRoot) or $(packageRoot)

@Cpcrook, Thank you. However, it is very weird to manually search and locate the TechTalk.SpecFlow.dll from the local cache.

@joshuakaling Please open a new issue with all requested informations, so we can reproduce the issue.
This issue is about VS 2013 and not VS2017.

@SabotageAndi the issue for which I described the solution was actually with VS2017, not 2013.

@joshuakaling Agreed. That behavior is something I've not seen before with any other package or extension.

@Cpcrook yes, this "fixes" it. But why wasn't the reference there. That's the question. You shouldn't need to do this.

Totally agree, @SabotageAndi, just making it clear that is isn't isolated to VS2013.

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.

Was this page helpful?
0 / 5 - 0 ratings