Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly TechTalk.SpecFlow, Version=3.1.0.0 #1939

Closed
8 of 33 tasks
Duke4848 opened this issue Apr 8, 2020 · 8 comments
Closed
8 of 33 tasks

Could not load file or assembly TechTalk.SpecFlow, Version=3.1.0.0 #1939

Duke4848 opened this issue Apr 8, 2020 · 8 comments

Comments

@Duke4848
Copy link

Duke4848 commented Apr 8, 2020

SpecFlow Version:

  • 3.1
  • 3.0
  • 2.4
  • 2.3
  • 2.2
  • 2.1
  • 2.0
  • 1.9

Used Test Runner

  • SpecFlow+Runner
  • MSTest
  • NUnit
  • Xunit

Version number:

Project Format of the SpecFlow project

  • Classic project format using packages.config
  • Classic project format using <PackageReference> tags
  • Sdk-style project format

.feature.cs files are generated using

  • SpecFlow.Tools.MsBuild.Generation NuGet package
  • SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • VS 2019
  • VS 2017
  • VS 2015

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • Enabled
  • Disabled

Are the latest Visual Studio updates installed?

  • Yes
  • No, I use Visual Studio version <Major>.<Minor>.<Patch>

.NET Framework:

  • >= .NET 4.5
  • before .NET 4.5
  • .NET Core 2.0
  • .NET Core 2.1
  • .NET Core 2.2
  • .NET Core 3.0

Test Execution Method:

  • Visual Studio Test Explorer
  • TFS/VSTS/Azure DevOps – Task – FAILS before test start
  • Command line – PLEASE SPECIFY THE FULL COMMAND LINE

Issue Description

Out of the blue since 07.04.2020 with no code nor pipeline changes the build executed in Azure DevOps fails I get:

System.IO.FileNotFoundException: Could not load file or assembly
'TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral,
PublicKeyToken=xxxxxx'. The system cannot find the file specified.
File name: 'TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral,
PublicKeyToken=0778194805d6db41'

I actually see this attribute in the generated code: [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.1.0.0")] however I don't use explicitely version 3.1.0.0 of Specflow anywhere

these are packages that I have
https://i.stack.imgur.com/9vpnJ.png

@Duke4848 Duke4848 changed the title Could not load file or assembly 'TechTalk.SpecFlow, Version=3.1.0.0 Could not load file or assembly TechTalk.SpecFlow, Version=3.1.0.0 Apr 8, 2020
@SabotageAndi
Copy link
Contributor

Which .NET Core SDK are you using?

@Duke4848
Copy link
Author

Duke4848 commented Apr 8, 2020

Which .NET Core SDK are you using?

Net. Core 2.2.0

@SabotageAndi
Copy link
Contributor

I didn't mean the .NET Core version, but the .NET Core SDK version.

This is the output of dotnet --info:
image

Here you see the used SDK version.

@Duke4848
Copy link
Author

Duke4848 commented Apr 8, 2020

I didn't mean the .NET Core version, but the .NET Core SDK version.

This is the output of dotnet --info:
image

Here you see the used SDK version.

.NET Core SDK (reflecting any global.json):
Version: 3.1.201

@SabotageAndi
Copy link
Contributor

Ok, then it is probably this issue: #1912
There is a problem with the .NET Core 3.1.200 SDK. Try the described workaround.

And as the build agents on Azure DevOps are updated regularly with the newest SDKs, that's the reason why it started suddenly to fail.

@Duke4848
Copy link
Author

Duke4848 commented Apr 8, 2020

nts on Azure DevOps are updated regularly with the newest SDKs, that's the reason why it started suddenly to fail.

You are correct. I applied the fix with setting MSBUILDSINGLELOADCONTEXT to 1 in the pipeline, it helped. Thank you! :)

@SabotageAndi
Copy link
Contributor

Solved => issue closed

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants