3
votes

I am new to Specflow and C#. Currently, I am facing one issue after updating the .net core as 2 and .net framework version as 4.6.2.

Specflow - Code behind cs file is not getting generated properly. Instead I am getting the below error in the specflow feature-code behind file.

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

How can I sort out this issue?

2

2 Answers

4
votes

FYI: SpecFlow doesn't support .NET Core yet.

To fix your issue, you need the VS Integration in version 2017.1.14 (should be updated automatically - link: https://github.com/techtalk/SpecFlow.VisualStudio/releases/tag/v2017.1.14) and use SpecFlow >= 2.3.0.

4
votes

The above issue is solved with the specflow older version after doing the below steps.

  • Delete the Code Behind file
  • Close the Visual Studio
  • Open the visual Studio again
  • Regenerate the feature file again.