Specflow generator not found on generating feature designer code for xUnit in Visual Studio 2015

530 views
Skip to first unread message

Sergii Gedikov

unread,
May 21, 2017, 11:23:54 AM5/21/17
to SpecFlow
Hi guys,
I have a problem with adding new features or re-generating old ones for my test project.
I have a visual studio 2015. Test project has .net version 4.5.2.

Content of app.config is following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>  
  <specFlow>
    <unitTestProvider name="xUnit" />    
  </specFlow>  
</configuration>

Content of packages.config is following:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Selenium.Support" version="3.4.0" targetFramework="net452" />
  <package id="Selenium.WebDriver" version="3.4.0" targetFramework="net452" />
  <package id="SpecFlow" version="2.1.0" targetFramework="net452" />
  <package id="SpecFlow.xUnit" version="2.1.0" targetFramework="net452" />
  <package id="xunit" version="2.1.0" targetFramework="net452" />
  <package id="xunit.abstractions" version="2.0.0" targetFramework="net452" />
  <package id="xunit.assert" version="2.1.0" targetFramework="net452" />
  <package id="xunit.core" version="2.1.0" targetFramework="net452" />
  <package id="xunit.extensibility.core" version="2.1.0" targetFramework="net452" />
  <package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net452" />
  <package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net452" />
</packages>

Features that are currently present in the project have proper designer code: 
//  <auto-generated>
//      This code was generated by SpecFlow (http://www.specflow.org/).
//      SpecFlow Version:2.1.0.0
//      SpecFlow Generator Version:2.0.0.0
System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "2.1.0.0")

but new ones are added with the next code:

//  <auto-generated>
//      This code was generated by SpecFlow (http://www.specflow.org/).
//      SpecFlow Version:1.9.0.77
//      SpecFlow Generator Version:1.9.0.0
//      Runtime Version:4.0.30319.42000
System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")

This prevents project from building successfully because of xUnit related compilation errors (new code is generated with IUseFixture while xUnit 2 requires IClassFixture, and other versions mismatch related errors).
I don't know when things went wrong unfortunately.

Specflow output shows following information:

[17:36:53.8816003] VsGeneratorInfoProvider: Discovering generator information...
[17:36:53.8816003] VsGeneratorInfoProvider: Runtime found at C:\TFS\Test\v5.03\packages\SpecFlow.2.1.0\lib\net45
[17:36:53.8816003] VsGeneratorInfoProvider: Unable to detect generator path
[17:36:53.8816003] RemoteGeneratorServices: Unable to detect generator location: the generator bound to the IDE is used
[17:36:53.8816003] VsGeneratorServices: Discover project settings
[17:36:53.9486813] VsGeneratorServices: Discover project settings
[17:36:53.9496945] VsGeneratorInfoProvider: Discovering generator information...
[17:36:53.9496945] VsGeneratorInfoProvider: Runtime found at C:\TFS\Test\v5.03\packages\SpecFlow.2.1.0\lib\net45
[17:36:53.9496945] VsGeneratorInfoProvider: Unable to detect generator path
[17:36:53.9496945] RemoteGeneratorServices: Unable to detect generator location: the generator bound to the IDE is used


I've tried to re-install Specflow extension itself in visual studio, all specflow and xunit related packages in nuget, deleted temp files but still no use.
Is Specflow.Generator.dll should be present in packages folders? Because I cannot locate it and re-install of packages does not help.
Message has been deleted

Sergii Gedikov

unread,
May 21, 2017, 1:15:36 PM5/21/17
to SpecFlow

Sorry, guys. The problem is solved.
In case someone out there will face the same issue, here what I did to solve it:
- uninstalled SpecFlow and SpecFlow.xUnit packages in nuget;
- uninstalled SpecFlow extension in Visual Studio and closed VS;
- manually deleted folder with installed extension in AppData\Local\Microsoft\VisualStudio\14.0\Extensions\<generated extension folder>;
- launched VS and installed SpecFlow extension;
- opened test project solution and installed the latest available pre-release version of SpecFlow.xUnit and SpecFlow (on the moment of writing this comment it's v2.2.0-preview20170510). 

In result, additional specflow libraries appeared in packages folder (like Generator, Parser etc). But now feature files re-generation failed with message related to 'missing generator library with 1.9.0.77 version' or something like that.
Then I uninstalled pre-release SpecFlow and SpecFlow.xUnit packages in nuget and installed latest stable version of both packages (presently, 2.1.0).
That solved it.

Andreas Willich

unread,
May 23, 2017, 4:53:33 AM5/23/17
to SpecFlow
The current prerelease has a bug (which is already fixed) in the generation.


--
You received this message because you are subscribed to the Google Groups "SpecFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages