简体   繁体   中英

SpecFlow codebehind file generated but not attached to feature file

I'm pretty new to SpecFlow and I've been having problems with the codebehind files. I can see them being generated in my files, but they're not visible in VS, meaning the codebehind files are not attached to the feature file. This leads to the following error:

    ---- System.Configuration.ConfigurationErrorsException : Configuration system failed to initialize
    -------- System.Configuration.ConfigurationErrorsException : Unrecognized configuration section specFlow. (\bin\Debug\somefile.dll.config line 52)
    ---- The following constructor parameters did not have matching fixture data: FixtureData fixtureData

Deleting the feature.cs and rebuilding the solution does not help.

Downloaded an extension called "File Nesting". When I build I add the generated feature file as an existing item, then I nest it in the feature file using the extension.

I came across similar problems when I upgraded from direct DLL reference to Specflow version 2.2.0 - to NuGet reference of version 3.1.7.4.

I needed to "Show All Files" in Visual Studio to see the code behind file at a sibling level to its associated Feature file (this used to be an associated child file of the feature file in the previous Specflow version).

I also need to use the "Include In Project" context menu item on the code behind file for it to show up in Visual Studios "Test Explorer". See Open issue in github, which states that you have to use the NuGet reference to get the tests to work in Test Explorer: https://github.com/techtalk/SpecFlow/issues/1617

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM