Reputation: 578
I was cleaning up an inherited test automation project and fixed some spelling errors in scenario names in a SpecFlow feature file, then started receiving this error:
CS1029
#error Generation error: Interface cannot be resolved: TechTalk.SpecFlow.Generator.UnitTestProvider.IUnitTestGeneratorProvider('custom')
There is no customer unit test provider.
Things I have tried:
Now, all my feature files are showing that error, not just the one I fixed spelling errors in. I'm using VS2015. Any ideas what could cause this error?
Upvotes: 2
Views: 6303
Reputation: 578
This seems to be some issue with corruption of SpecFlow 2.2 feature files.
With 2.2, deleting and recreating the feature files did not solve the problem. Reverting to 2.1 did.
After reverting to 2.1, the errors still occurred UNTIL I deleted the feature file then recreated it. I had 8 feature files, all reporting the error. After deleting and recreating each one, all 8 errors went away.
Upvotes: 1
Reputation: 59020
In the app.config, make sure the unit test provider name you're using corresponds to an actual test framework. Ex:
<specFlow>
<unitTestProvider name="nUnit" />
</specFlow>
My suspicion is that the tests were generated using a valid app.config, but the app.config is no longer valid. When you changed the feature file(s), it caused it to attempt to regenerate the tests using an invalid test framework provider name, leading to the error message you're seeing.
Upvotes: 1