SpecRun+MsTest failing under ReSharper

667 views
Skip to first unread message

Vlad Bulkin

unread,
Sep 12, 2013, 4:14:49 PM9/12/13
to spe...@googlegroups.com
I have a simple setup that runs fine from VS2012 Test Explorer but fails from ReSharper:
 
Class Initialization method AAMVA.S2S.TPS.AcceptanceTests.Features.Foo1Feature_MsTest.FeatureSetup threw exception. TechTalk.SpecFlow.SpecFlowException: TechTalk.SpecFlow.SpecFlowException: Unable to load plugin: SpecRun. Please check http://go.specflow.org/doc-plugins for details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'SpecRun.SpecFlowPlugin' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.

Here is the config section:
  <specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    <!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider -->
    <unitTestProvider name="SpecRun+MsTest" />
    <plugins>
      <add name="SpecRun" />
    </plugins>
    <stepAssemblies>
      <stepAssembly assembly="AAMVA.S2S.TPS.RegressionTests" />
    </stepAssemblies>
  </specFlow>

Am I doing something wrong? Looks like plugin files are not deployed.
All latest nuget packages.

Thanks!

Vlad Bulkin

unread,
Sep 13, 2013, 11:13:04 AM9/13/13
to spe...@googlegroups.com
So this issue can be corrected in an awkward way by manually adding MsTest partial class with DeploymentItemAttribute:

    [DeploymentItem("SpecRun.SpecFlowPlugin.dll")]
    [DeploymentItem("RegressionTests.dll")]
    [DeploymentItem("RegressionTests.pdb")]
    public partial class Foo1Feature_MsTest
    {
    } 

Since we do a lot of late binding we have to use DeploymentItemAttribute alot in our mstests. How can we accomplish it with SpecRun+MsTest without resorting to partial mstest classes?

Thanks! 

Armaan Aziz

unread,
Jan 17, 2014, 11:58:58 AM1/17/14
to spe...@googlegroups.com
Did you manage to get this to work without the workaround mentioned below. Trying to get started with Specrun and I am getting the same error message

Gáspár Nagy

unread,
Jan 20, 2014, 4:50:06 AM1/20/14
to spe...@googlegroups.com
Two ideas:
1. Try to switch off shadow copying in ReSharper config
2. MsTest tries to be too smart to decide which assemblies are needed. If you access something dummy from the plugin assembly (e.g. declare a local variable somewhere from one of the types in the assembly, without even using it) even in a dummy class, it will also copy that assembly too.

Armaan Aziz

unread,
Jan 20, 2014, 5:48:45 AM1/20/14
to spe...@googlegroups.com
HI Gaspar, 

Turning shadow copying does not work as it gives me this error below:

TechTalk.SpecFlow.SpecFlowException: TechTalk.SpecFlow.SpecFlowException: Unable to load plugin: SpecRun. Please check http://go.specflow.org/doc-plugins for details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'SpecRun.SpecFlowPlugin' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.

any ideas?

Gáspár Nagy

unread,
Jan 20, 2014, 2:01:10 PM1/20/14
to spe...@googlegroups.com
:( and what about my other idea?

Ben Ellis

unread,
Aug 20, 2014, 6:13:59 AM8/20/14
to spe...@googlegroups.com
I know this is an old post, but just to post a possible solution in case anyone else needs it.

I'm using Resharper 7.1.3 and this worked for me,

Resharper | Options | Unit Testing | MSTest - Uncheck the "Use Legacy Runner" and hit Save
Reply all
Reply to author
Forward
0 new messages