Specflow: Code behind generate error with latest releases

Created on 28 Feb 2018  Â·  7Comments  Â·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version:

  • [x] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

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


Version number:

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 -->
    <unitTestProvider name="MsTest" />
    <stepAssemblies>
      <stepAssembly assembly="Hayai-TestTools"></stepAssembly>
    </stepAssemblies>
  </specFlow>

Issue Description

Code behinds of feature files contains error message:

error Generation error: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401).

I downgraded to integration 2017.1.6.vsix to make work again

Steps to Reproduce


Only creating a .net fw 462 test project with a feature file.

Generator MSTest

Most helpful comment

This error is fixed with SpecFlow 2.3.

All 7 comments

This error is fixed with SpecFlow 2.3.

you are totally right

@omarpiani Can I close the issue? Is it fixed for you?

yes, there was other people like me in #922 with same problem

@omarpiani thanks!

I have updated to the latest version of 2017 & installed the Specflow 3 preview extension as well. When adding a new specflow file the code behind fail and throws the following error.

We could not find a data exchange file at the path Unhandled Exception: System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)

Please open an issue at https://github.com/techtalk/SpecFlow/issues/
Complete output:

Unhandled Exception: System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.CommandLineHandling.PreLoadAssemblies()
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.CommandLineHandling.PreLoadAssemblies()
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Program.Main(String[] args)

Command: c:usersdbaigappdatalocalmicrosoftvisualstudio15.0_ef1f29faextensionsofkcgrbe.xrdTechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.exe
Parameters: GenerateTestFile --featurefile C:UsersDBaigAppDataLocalTemptmp3E42.tmp --outputdirectory C:UsersDBaigAppDataLocalTemp --projectsettingsfile C:UsersDBaigAppDataLocalTemptmp3E3E.tmp
Working Directory:

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