SpecFlow and NCrunch: multi-threaded error while executing in single thread
<p>We updated our solution from SpecFlow1.9 to 2.0 and NUnit2.6.4 to 3.2.1. After adapting some attributes and project settings, all tests run fine in NUnit. However, when the SpecFlow tests are executed with NCrunch, we get a SpecFlowException:</p>

<pre><code>TechTalk.SpecFlow.SpecFlowException : The ScenarioContext.Current static accessor cannot
 be used in multi-threaded execution. Try injecting the scenario context to the binding
 class. See http://go.specflow.org/doc-multithreaded for details.
 at TechTalk.SpecFlow.ScenarioContext.get_Current()
</code></pre>

<p>We intentionally designed our SpecFlow tests for a single-threaded environment (to keep the effort low) and we just want to continue executing these tests in one thread. So instead of injecting the scenario context as the proposed solution (we use NInject instead of the SpecFlow mini-IoC) we're looking for some setting to convince SpecFlow that it is running in a single-threaded environment.  </p>

<p>Here are the NCrunch 2.23.0.2 settings:
<img src="https://i.stack.imgur.com/ZdMKk.png" alt=""></p>

<p>I entered in the Assembly.cs files of all SpecFlow tests the following attribute:</p>

<pre><code>[assembly: Parallelizable(ParallelScope.None)] 
</code></pre>

<p>Without success; the exception keeps showing up. </p>

<p><em>Does anybody have a clue how to force SpecFlow2.0 in NCrunch2.23.0.2 with NUnit3.2.1 so that it thinks it's executing in a single-threaded environment?</em></p>

<p>Thank you for your effort!</p>

<p><strong>2016-5-31: update</strong></p>

<p>I installed the new version 2.1 of SpecFlow (available since 2016-5-25) but it didn't solve the problem.</p>

<p>I created an <a href="http://fair-homepage.ch/data/SpecFlow2NCrunchProblem.zip" rel="nofollow noreferrer" title="example project">example project</a> with a minimum amount of code to generate the problem. The calculator implementation is statefull and cannot be tested in a multithreaded environment.</p>

<p>SpecFlow throws the exception due to the (dummy) static reference ‘ScenarioContext.Current’ in CustomContext. Yes I know you should inject it if you intend to run in a multithreaded test environment. The problem is that SpecFlow THINKS it is in a multithreaded environment, but it isn’t and it shouldn't.</p>