7
votes

I have seen this question before but I believe it was not resolved. Basically my set up is this: VS 2015 Specflow ver 1.9.0 (I downgraded to this from 2.1.0 based on other question which didn't help)

When I try to build my project, it comes with the follwoing error:

#error Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified.
2
Where is the dll located? Normally a dll is added to project by "Adding Existing Item". The dll is then put into the project folder. When you compile the dll is then moved by the compiler to the bin/debug or bin/release folder. The error message indicates the dll is not in the release of debug folder. Check to see if you project is building the debug or release version. Then check if the dll is in the folder. Often people just move the dll into the debug or release folder then run clear all which deletes the dll from the debug/release folder cause this error. - jdweng
There's no dll in the release or debug folder in the bin folder. In the past, this contains all the dll so not sure why this is empty - Ade Bakre
I suspect somebody just dropped the dlls into the folder instead of adding to the list of references. - jdweng

2 Answers

4
votes

Check your package.config and see if it has an entry for TechTalk.SpecFlow. If yes, then delete the entry from package config file ... as well delete all the assembly related to that dll. Re-install the specific version from NuGet and re-compile your project.

Per your comment it still targeting the new version newVersion="2.1.0.0" and not the new version Version=1.9.0.77. Change your app.config like to be

<assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" /> 
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="1.9.0.77" /> 
0
votes

Just uninstall specflow from VS menu - Tools >> Extension and Updates and reinstall. It will ask for VS restart while doing so and you are all set.