Closed echalone closed 2 years ago
WTH is happening here?
Console.WriteLine
is failing
C:\Users\
.nuget\packages\specflow.tools.msbuild.generation\3.9.22\build\SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: at System.Console.WriteLine(String value) [ ]
Not sure if we can do here anything. 🤷♂️
WTH is happening here is about the same reaction I had 😅 If only I could reproduce it reliably... If you think it ain't a problem of SpecFlow, do you have an idea which part may have the bug in it? Maybe Visual Studio or .NET 5 or something like that?
It can anything that is connected to the Console. That can be .NET, that can be the shell you are using to execute dotnet test
. That can be the OS.
What you could try is to make a small console application that calls on a lot of threads Console.WriteLine
and execute this like the tests. Perhaps you can reproduce it this way and reduce the possible candidates.
Oh you see, that's the fun part, it's not happening during dotnet test, it's happening during dotnet build... and we didn't change anything in the code for months. It says something along the lines of "SpecFlowFeatureFiles: " then tries to generate the specflow project files but then sometimes generates the above mentioned error during the GenerateFeatureFileCodeBehindTask task. It's also only happening to the SpecFlow projects, though other project types are in the solution too. So that's why I'm suspicious of SpecFlow here ^^
Mmmm, interesting. I overlooked that this happens in our MSBuild Task. Perhaps there is a problem with Console.WriteLine inside an MSBuild task.
I created a PR to use the MSBuild logging and removed the one output that is running to Console.WriteLine at Compile Time. https://github.com/SpecFlowOSS/SpecFlow/pull/2590
It should be in master and on NuGet next week.
Thank you very much! :) Meanwhile I was already able to exclude PowerShell Core, NodeJS, MSBuild, Visual Studio 2022, the Azure DevOps Build-Agent and .NET 5/6 as the reason for the error. They are all used one way or another and I was able to change them back to an older version with which it still worked a few months back, or even remove them from the build-step if possible, and the error still occured. I also updated them all to the latest version and the error still occured. By now I was also able to reproduce it on an Intel machine, so it's also not AMD specific.
@echalone new version is pushed to NuGet.org. Please update and try it out and report back if the issue is gone now.
Thank you :) I've already begun testing and will report back in the coming days :)
Alright, after several days of testing I wasn't able to reproduce the issue any longer with version 3.9.74. Looks like it's fixed, thank you :)
Und schöne Grüße von Wien nach Wien übrigens :D
Awesome! So I close this issue.
Schöne Grüße ebenfalls!
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.
SpecFlow Version
3.9.22
Which test runner are you using?
NUnit
Test Runner Version Number
3.13.1
.NET Implementation
.NET 5.0
Project Format of the SpecFlow project
Sdk-style project format
.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation NuGet package
Test Execution Method
TFS/VSTS/Azure DevOps – Task DotNetCoreCLI@0 (dotnet build)
SpecFlow Section in app.config or content of specflow.json
Issue Description
Sometimes during dotnet build step the following error is being generated (sometimes for just one specflow project, sometimes for two and sometimes for all three specflow projects):
Steps to Reproduce
Sadly this cannot be realiably reproduced but has happened on two different AMD machines (One Epyc server and one Threadripper PC) so far during the dotnet building of the specflow projects. The .NET 5 SDK in use is 5.0.406 through Visual Studio 2022 Enterprise Edition Version 17.1.5 (Current channel).
Link to Repro Project
No response