Riaz Ladhani Riaz Ladhani - 5 months ago 70
C# Question

Could not load file or assembly TechTalk.SpecFlow, Version=

I am trying out BDD in Visual Studio 2013. I have started a fresh new blank project. I have written the feature file and steps definition. I added SpecFlow using NugGet packages. It installed SpecFlow version 2.1.0
When I build the solution it is looking for SpecFlow version

When I searched for SpecFlow in NugGet packages only 1 was listed. I installed it and i believe it was the latest version 2.1.0
Why is the solution looking for an older version of ?
If the resolution is to install how do i install it and I how i find this version in NugGet?

The full error trace is:

Custom tool error: Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified. E:\RL Fusion\projects\BDD\C# BDD\youtubetutorial2\specflowfirst\SpecflowFirst\SpecflowFirst\Features\GoogleSearch.feature 2 2 SpecflowFirst

Thanks, Riaz

The imports are:

using Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.Assist;


Baseclass.Contrib.SpecFlow.Selenium.NUnit does only work with SpecFlow 1.9.0. It claims that it work with versions after 1.9, but this is not true, because we changed the plugin- interface in SpecFlow. Did you wanted to use it, because of the ability to test against multiple browser with only one scenario?

If so, have a look at this example https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/SeleniumWebTest which uses the SpecFlow+Runner as test runnner.
If you follow that, you have the same functionality and you can use the latest version of SpecFlow.

Full Disclosure: I am one of the developers of SpecFlow and SpecFlow+.