Reputation: 4645
When I add a new SpecFlow-feature file to our solution, I get the following error:
Generation error: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.
This has never happened before, last friday it worked without any problem.
I've tried to remove the reference to Microsoft.Build.Framework and readd it but it didn't have any effect...
Thanks in advance
Edit: I've made sure that the assembly is reference with the correct version but the error is still there...
Upvotes: 1
Views: 1276
Reputation: 4645
I fixed the problem with the following steps:
<Import Project="..\packages\SpecFlow.2.2.1\tools\TechTalk.SpecFlow.targets" Condition="Exists('..\packages\SpecFlow.2.2.1\tools\TechTalk.SpecFlow.targets')" />
at the end of the project fileSpecFlowSingleFileGenerator
from the feature filesSpecFlowSingleFileGenerator
to the feature filesthis helped me this time...
Upvotes: 0
Reputation: 5825
This is a known issue (https://github.com/techtalk/SpecFlow/issues/857) for what we don't have a fix yet.
Sometimes deinstalling and reinstalling the Visual Studio extension helps.
The best workaround is to not generate the code-behind files when you save the feature file, but to generate them when you compile your project.
Have a look at the documentation for that: http://specflow.org/documentation/Generate-Tests-from-MsBuild/
You simply have to import one target file in your csproj and remove the CustomTools from the feature files in the project explorer.
Upvotes: 1