Specflow: Specflow scenarios not running in VS 2017 - Unable to load one or more of the requested types

Created on 14 Apr 2018  ·  11Comments  ·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version: 1.5.2

  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner : Specrun.Runner

  • [ ] SpecFlow+Runner
  • [ ] MSTest
  • [ ] NUnit
  • [ ] Xunit


Version number:
1.5.2

Visual Studio Version

  • [x] VS 2017
  • [ ] VS 2015
  • [ ] VS 2013

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No

.NET Framework:

  • [x] >= .NET 4
  • [ ] before .NET 4

Test Execution Method:

  • [x] Visual Studio Test Explorer
  • [ ] TFS/VSTS – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

<SpecFlow> Section in app.config

<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" /> 
    <plugins>
      <add name="SpecRun" />
    </plugins>
  </specFlow>

Issue Description

While running any specflow scenario the error

_"Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information"_ is thrown. On further debugging the cause is

Could not load file or assembly 'TechTalk.SpecRun.VisualStudio.TestAdapter.XmlSerializers, Version=1.5.2.0

I recently upgraded certain nuget packages in my project. could that be an issue since the binding redirects are not properly set?

SpecFlow+

Most helpful comment

Hi @raghav710

I sorted out my issue 1 hour after the post earlier.

All I had to do was to give up my reliance on SpecRun.Runner and include SpecRun.Nunit in the solution.

Many Thanks

All 11 comments

EDIT: This comment was moved to it's own ticket.

@raghav710 Sometimes a VS cache gets corrupted. Try these steps:

  1. Close all Visual Studio instances
  2. Navigate to your %TEMP%\VisualStudioTestExplorerExtensions\ folder and delete any sub-folders related to SpecFlow/SpecRun.
  3. Reopen your solution and ensure that it builds.

@DanBailiff Your issue is something different.
Please open a new issue for it (I saw your post on the forum, but had not yet time to answer).

OK thanks!

Closed because of inactivity. Please reopen if you have additional information.

Apologies for the delay. Just want to add that what worked for me then was to delete all the feature.cs files, close Visual Studio, reopen and regenerate the files

Hi @raghav710 ,
I installed VS2017 Enterprise 15.8.4 yesterday (btw - I have a company provided MS subscription), and started suffering from shocks you have described straightway. Unfortunately, none of the previous tricks like clearing cache (what not), deleting and regenerating features did not work (like for previous Releases).

After toiling for a day to resolve this and failing, I firmly believe if I back track to a release 15.7.5 or older, it might fix this issue. Can someone please advise where to download a previous version of VS 2017 Enterprise.

Many Thanks

Hi @raghav710

I sorted out my issue 1 hour after the post earlier.

All I had to do was to give up my reliance on SpecRun.Runner and include SpecRun.Nunit in the solution.

Many Thanks

@mannyb2001 thanks for sharing what worked for you! 👍

@mannyb2001 Could you please explain what you did exactly?

@SabotageAndi , like I explained above, I added SpecRun.Nunit nuget to the project where feature tests exist and all worked from thereon.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings