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
Multiple "Could not load file or assembly errors" after updating to Specflow 3 and MsBuild #1717
Comments
Do you have also the problem, when you compile one of our examples? |
@SabotageAndi getting the same exception when compiling this solution https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/SeleniumWebTest |
Ok, that is very strange. Do you have VS2019 to try it to build it the example with it? |
@SabotageAndi I tried in VS2019 Community and it works fine, but VS2017 Professional still throwing the exception |
@okyrylenko I think then something is missing in your VS2017 installation. |
@SabotageAndi I am doing everything that listed here - https://specflow.org/2019/updating-to-specflow-3/ Considering, I am using the same VS as I used with SpecFlow 2 which I had no issue, I suspect SpecFlow 3 broke something. Is there anything missing from this document? |
Not that I know of. I will create a new VS2017 only VM and try it there and report back. |
So I tried it now on a new Azure VM that has only VS2017 installed and it was working. I exported the installation config. It looks like it's a complete installation (nearly all workloads are installed) What happens if you try to build your project on the command line with |
Hello, It was a netstandard reference. |
I think I should open a separate issue, but I wanted to pitch in because I also think there are issues with When I try to use it with VS2015, SpecFlow 3 extension and the specflow 3 nuget, as soon as I add the MSBuild generation package, the project containing SpecFlow features cannot be loaded by VS2015. The same project works fine in VS2019, but in VS2015 I get an error (I'm translating the error from French so it may not be the same in English): error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. The issue seems to be the <Project TreatAsLocalProperty="TaskFolder;TaskAssembly"> Clearly, MSBuild expects an <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\SpecFlow.Tools.MsBuild.Generation.3.0.225\build\SpecFlow.Tools.MsBuild.Generation.props" Condition="Exists('..\packages\SpecFlow.Tools.MsBuild.Generation.3.0.225\build\SpecFlow.Tools.MsBuild.Generation.props')" /> The MSBuild that is used by my VS2015 is version 14, located in |
@SylChamber You are right. It is not compatible with older MSBuild versions than 15. It it not only the xmlns, we also use features that are only available with MSBuild 15. (e.g. ItemGroup Update) |
I am having the same issue after upgrading from specflow 2.x to 3.x I am using Visual Studio 2017 and .net 4.6.1. |
Thanks @SabotageAndi, I missed that part in the doc. I have colleagues that experience instability with SpecFlow v3 extension with SpecFlow nuget v2.4 in VS2019. They are testing moving from VS2015 to VS2019 and SpecFlow is a deal breaker for now. (I rather suspect an issue with the antivirus because the symptom is long freezes and I'm having more general issues with that antivirus config.) But we're outside the scope of the current issue. :) Thanks for the help. |
@SylChamber please open a separate issue. I would be interested in the instability issues you are experience in VS2019. |
@SabotageAndi We are still having issues with v3. We have a Framework 4.7.1 project here and it fails in our Build Server, where we do not have/want dotnet core libraries.
Do you have any idea why this might happen? |
@miguelmcorreia sorry, no idea. My assumption is, that something is not installed. I could not reproduce this issue on all of my machine I have available. |
@miguelmcorreia - I'm also seeing this issue on a new SpecFlow project I've created. The build and execution of tests works fine locally (VS2019 .net framework proj) but our build server (MSBuild15.0) fails with the following: Did you discover a workaround? |
Similar errors, seemingly out of nowhere in our GitLab build pipeline (Linux runners): Framework: .Net Core 3.1 Everything has been working fine, then all of the sudden multiple unrelated branches started failing in our pipelines (even branches that had previously passed). So only logical thing is there was a change to a 3rd party package somewhere or to the runner itself. Specific error is:
If this is not close-enough to the original issue reported, I'll happily create an issue. This is just the first thread I've found that seems like it might be the same core issue. |
We've did some investigation and found it has something to do with an update in .NET Core which causes Specflow not to run properly anymore (dotnet/core#4404). We've solved it, short-term, by locking our .NET Core version to 3.1.102 |
@Jandev & @Shanson90 I created a separate issue for the .NET Core 3.1.200 SDK problem: #1912 |
Try to install |
I got the same issue but got resolved, We need to upgrade Windows 10 to version 1703 or Higher version. |
As we stopped maintaining the SpecFlow+ Runner (https://specflow.org/using-specflow/the-retirement-of-specflow-runner/) I am closing this issue. |
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. |
Multiple "Could not load file or assembly errors" after updating to Specflow 3 and MsBuild
SpecFlow Version:
Used Test Runner
Version number:
3.0.377
Project Format of the SpecFlow project
packages.config
<PackageReference>
tags.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation
NuGet packageSpecFlowSingleFileGenerator
custom toolVisual Studio Version
Enable SpecFlowSingleFileGenerator Custom Tool
option in Visual Studio extension settingsAre the latest Visual Studio updates installed?
<Major>.<Minor>.<Patch>
.NET Framework:
Test Execution Method:
<SpecFlow> Section in app.config or content of specflow.json
Repro Project
Issue Description
I am updating from SpecFlow 2 to SpecFlow 3. I followed all the steps on this page - https://specflow.org/2019/updating-to-specflow-3/
When I compile, I get the same exception for every feature file I have in my solution. Exception bellow
Steps to Reproduce
The text was updated successfully, but these errors were encountered: