8

I'm getting this error trying to build a project. It's highlighting words in my feature pages and giving me this error.

Error 1 The name 'GenerationTargetLanguage' does not exist in the current context

I tried to Run Custom Tool on each feature but that made my errors go from two of the same, to three of these errors.

Found one other person with the problem in the google groups. No solution.

3 Answers 3

8

I had the same problem when i installed the newest version of specflow and tried to compile an example project because the example had a local copy of an older version of the specflow dll. The new specflow - feature-file compiler generates sourcecode for a call to a non existing specflow-dll method signature.

I solved the problem by replacing the specflow-dll in the projects lib-directory with with the dll from my newer installation.

1
  • Thanks that was right on. I updated the DLL to the newer version I had installed and it worked.
    – Mastro
    Commented Jan 28, 2011 at 4:30
6

I ran into the exact same error under different circumstances. I had originally (early 2011) installed Specflow v1.5.0.0 using the msi installer, but just today used NuGet to install version 1.8.1.0 for a particular project (using Install-Package SpecFlow -ProjectName MyProject).

I quit all instances of Visual Studio, downloaded and ran the msi installer for v1.8.1.0 and then fired up Visual Studio again, deleted my existing feature files and added new ones, and everything worked.

1
  • I did not have to delete and recreate the feature files. I opened each feature file and made a small change (line feed) causing the parser to recreate the feature.cs file. Commented Jan 20, 2012 at 15:24
1

I found it was a breaking change. In the xyz.feature.cs the enum GenerationTargetLanguage.CSharp should now be replaced with ProgrammingLanguage.CSharp

1
  • when you upgrade it will ask for the features to be re-generated
    – pkr2000
    Commented Apr 23, 2012 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.