Specflow: Code generation fails on 3.1.97 on Mac using msbuild

Created on 19 Feb 2021  Â·  17Comments  Â·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version:

  • [ ] 3.7
  • [ ] 3.6
  • [ ] 3.5
  • [ ] 3.4
  • [ ] 3.3
  • [x] 3.1.97
  • [ ] 3.0
  • [ ] 2.4
  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

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


Version number: NUnit 3.13.1

Project Format of the SpecFlow project

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

.feature.cs files are generated using

  • [x] SpecFlow.Tools.MsBuild.Generation NuGet package
  • [ ] SpecFlowSingleFileGenerator custom tool

Visual Studio Version

  • [ ] VS 2019
  • [ ] VS 2017
  • [x] VS for Mac

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • [ ] Enabled
  • [ ] Disabled
  • [x] N/A

Are the latest Visual Studio updates installed?

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

.NET Framework:

  • [ ] >= .NET 4.5
  • [ ] before .NET 4.5
  • [ ] .NET Core 2.1
  • [ ] .NET Core 3.1
  • [ ] .NET 5.0
  • [x] Mono

Test Execution Method:

  • [x] Visual Studio Test Explorer
  • [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

<SpecFlow> Section in app.config or content of specflow.json

N/A

Issue Description

I'm using msbuild command to build UITest project on Mac. The project is a .NET library (cannot target .NET Standard/.NET Core because we use Xamarin.UITest which is still not compatible). It appears that older versions of SpecFlow work fine in this setup, but starting from 3.1.97 the build from the commandline fails.

Based on my testing the last version that worked on Mac with msbuild is 3.1.95 and since version 3.1.97 it stopped working.

To reproduce create sample project with at least one .feature file and run the following from the command line on Mac:

msbuild /t:restore UITests.csproj
msbuild UITests.csproj

Log

Microsoft (R) Build Engine version 16.6.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2/19/2021 5:36:36 PM.
Project "/Users/userx/Documents/Projects/Corp/App_xamarin/src/App.UITests/App.UITests.csproj" on node 1 (default targets).
UpdateFeatureFilesInProject:
  SpecFlowFeatureFiles: Features/Notebook.feature
  [SpecFlow] process: mono-sgen64, pid: 11026, CD: /Users/userx/Documents/Projects/Corp/App_xamarin/src/App.UITests
  [SpecFlow]   mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  [SpecFlow]   MSBuild, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  [SpecFlow]   Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  [SpecFlow]   System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  [SpecFlow]   System.Threading.Tasks.Dataflow, Version=4.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
  [SpecFlow]   System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  [SpecFlow]   System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
  [SpecFlow]   System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System.Numerics.Vectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow]   SpecFlow.Tools.MsBuild.Generation, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41
  [SpecFlow]   TechTalk.SpecFlow.Generator, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41
  [SpecFlow]   TechTalk.SpecFlow, Version=3.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41
  [SpecFlow]   BoDi, Version=1.4.1.0, Culture=neutral, PublicKeyToken=ff7cd5ea2744b496
  [SpecFlow]   System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  [SpecFlow] Starting GenerateFeatureFileCodeBehind
-> Using default config

=================================================================
    Native Crash Reporting
=================================================================
Got a segv while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Native stacktrace:
=================================================================
    0x1028e57c9 - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_dump_native_crash_info
    0x10287d69e - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_handle_native_crash
    0x1028df946 - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : altstack_handle_and_restore
    0x102a35a1e - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_dynimage_encode_typedef_or_ref_full
    0x102a2abc7 - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_image_get_memberref_token
    0x102a2aa95 - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_image_get_methodref_token
    0x102a2b2ea - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : mono_image_create_token
    0x10299d52a - /Library/Frameworks/Mono.framework/Versions/6.12.0/bin/mono : ves_icall_ModuleBuilder_getToken_raw
    0x10b34310a - Unknown
    0x10b2445eb - Unknown
    0x10b242dbb - Unknown

=================================================================
    Telemetry Dumper:
=================================================================
Pkilling 0x4562709952x from 0x123145336074240x
Pkilling 0x123145342402560x from 0x123145336074240x
Pkilling 0x123145340293120x from 0x123145336074240x
Pkilling 0x123145338183680x from 0x123145336074240x
Pkilling 0x123145333964800x from 0x123145336074240x
Pkilling 0x123145331855360x from 0x123145336074240x
Pkilling 0x123145329471488x from 0x123145336074240x
Pkilling 0x123145329745920x from 0x123145336074240x
Pkilling 0x123145327362048x from 0x123145336074240x
Pkilling 0x123145322070016x from 0x123145336074240x
Pkilling 0x123145325252608x from 0x123145336074240x
Entering thread summarizer pause from 0x123145336074240x
Finished thread summarizer pause from 0x123145336074240x.
Failed to create breadcrumb file (null)/crash_hash_0x274fded932

Waiting for dumping threads to resume

=================================================================
    External Debugger Dump:
=================================================================

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x102a35a1e):0x102a35a0e  89 45 d0 4c 89 6d b0 45 6b ac 24 5c 09 00 00 03  .E.L.m.Ek.$\....
0x102a35a1e  42 89 1c a8 49 8d bc 24 58 08 00 00 48 89 7d b8  B...I..$X...H.}.
0x102a35a2e  48 8b 5d a8 48 8b 73 40 e8 45 65 fe ff 48 8b 4d  H.][email protected]
0x102a35a3e  d0 42 89 44 a9 04 48 8b 73 48 48 8b 7d b8 e8 2f  .B.D..H.sHH.}../

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at System.Reflection.Emit.ModuleBuilder:getToken <0x00089>
      at System.Reflection.Emit.ModuleBuilder:GetToken <0x00245>
      at System.Reflection.Emit.ModuleBuilderTokenGenerator:GetToken <0x00042>
      at System.Reflection.Emit.ILGenerator:Emit <0x0004f>
      at Utf8Json.Resolvers.Internal.DynamicObjectTypeBuilder:BuildConstructor <0x000e9>
      at Utf8Json.Resolvers.Internal.DynamicObjectTypeBuilder:BuildType <0x0059a>
      at Utf8Json.Resolvers.Internal.DynamicObjectTypeBuilder:BuildFormatterToAssembly <0x0034a>
      at FormatterCache`1:.cctor <0x0009a>
      at System.Object:runtime_invoke_void <0x000a5>
      at <unknown> <0xffffffff>
      at System.Object:__icall_wrapper_mono_generic_class_init <0x00078>
      at Utf8Json.Resolvers.Internal.DynamicObjectResolverAllowPrivateFalseExcludeNullFalseNameMutateOriginal:GetFormatter <0x0006a>
      at FormatterCache`1:.cctor <0x000cb>
      at System.Object:runtime_invoke_void <0x000a5>
      at <unknown> <0xffffffff>
      at System.Object:__icall_wrapper_mono_generic_class_init <0x00078>
      at InnerResolver:GetFormatter <0x0006a>
      at FormatterCache`1:.cctor <0x00113>
      at System.Object:runtime_invoke_void <0x000a5>
      at <unknown> <0xffffffff>
      at System.Object:__icall_wrapper_mono_generic_class_init <0x00078>
      at Utf8Json.Resolvers.Internal.DefaultStandardResolver:GetFormatter <0x0006a>
      at Utf8Json.JsonFormatterResolverExtensions:GetFormatterWithVerify <0x0007e>
      at Utf8Json.Formatters.DictionaryFormatterBase`5:Deserialize <0x00172>
      at Utf8Json.JsonSerializer:Deserialize <0x000db>
      at Utf8Json.JsonSerializer:Deserialize <0x0006a>
      at Utf8Json.JsonSerializer:Deserialize <0x0008a>
      at Utf8Json.JsonSerializer:Deserialize <0x0007a>
      at Gherkin.GherkinDialectProvider:ParseJsonContent <0x0004a>
      at Gherkin.GherkinDialectProvider:LoadLanguageSettings <0x000da>
      at Gherkin.GherkinDialectProvider:TryGetDialect <0x00047>
      at Gherkin.GherkinDialectProvider:GetDialect <0x0005b>
      at TechTalk.SpecFlow.Parser.SpecFlowGherkinDialectProvider:GetDialect <0x000ba>
      at <>c__DisplayClass3_0:<.ctor>b__0 <0x00040>
      at System.Lazy`1:ViaFactory <0x0007d>
      at System.Lazy`1:ExecutionAndPublication <0x000d0>
      at System.Lazy`1:CreateValue <0x000e3>
      at System.Lazy`1:get_Value <0x00031>
      at Gherkin.GherkinDialectProvider:get_DefaultDialect <0x00042>
      at Gherkin.TokenMatcher:Reset <0x0005a>
      at Gherkin.Parser`1:Parse <0x00055>
      at TechTalk.SpecFlow.Parser.SpecFlowGherkinParser:Parse <0x000ea>
      at TechTalk.SpecFlow.Generator.TestGenerator:ParseContent <0x00058>
      at TechTalk.SpecFlow.Generator.TestGenerator:GenerateTestFileCode <0x000f9>
      at TechTalk.SpecFlow.Generator.TestGenerator:GetGeneratedTestCode <0x000e2>
      at TechTalk.SpecFlow.Generator.TestGenerator:GenerateTestFileWithExceptions <0x0017a>
      at TechTalk.SpecFlow.Generator.ErrorHandlingTestGenerator:GenerateTestFile <0x0007d>
      at SpecFlow.Tools.MsBuild.Generation.FeatureCodeBehindGenerator:GenerateCodeBehindFile <0x00114>
      at <GenerateFilesForProject>d__6:MoveNext <0x00212>
      at SelectEnumerableIterator`2:MoveNext <0x000e4>
      at System.Collections.Generic.LargeArrayBuilder`1:AddRange <0x0016b>
      at System.Collections.Generic.EnumerableHelpers:ToArray <0x00202>
      at System.Linq.Enumerable:ToArray <0x000aa>
      at SpecFlow.Tools.MsBuild.Generation.ProjectCodeBehindGenerator:GenerateCodeBehindFilesForProject <0x001b2>
      at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor:Execute <0x001d5>
      at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask:Execute <0x006d1>
      at Microsoft.Build.BackEnd.TaskExecutionHost:Microsoft.Build.BackEnd.ITaskExecutionHost.Execute <0x0009f>
      at <ExecuteInstantiatedTask>d__26:MoveNext <0x00bf2>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TaskBuilder:ExecuteInstantiatedTask <0x0019a>
      at <InitializeAndExecuteTask>d__24:MoveNext <0x00162>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000f2>
      at Microsoft.Build.BackEnd.TaskBuilder:InitializeAndExecuteTask <0x0019a>
      at <ExecuteBucket>d__19:MoveNext <0x0078a>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TaskBuilder:ExecuteBucket <0x0016a>
      at <ExecuteTask>d__18:MoveNext <0x0074a>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TaskBuilder:ExecuteTask <0x00112>
      at <ExecuteTask>d__13:MoveNext <0x005ea>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TaskBuilder:ExecuteTask <0x00262>
      at <ProcessBucket>d__51:MoveNext <0x001f5>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TargetEntry:ProcessBucket <0x001ba>
      at <ExecuteTarget>d__44:MoveNext <0x00d5a>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000fa>
      at Microsoft.Build.BackEnd.TargetEntry:ExecuteTarget <0x00172>
      at <ProcessTargetStack>d__21:MoveNext <0x00f02>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000fa>
      at Microsoft.Build.BackEnd.TargetBuilder:ProcessTargetStack <0x000fa>
      at <BuildTargets>d__10:MoveNext <0x00caa>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.TargetBuilder:BuildTargets <0x001fa>
      at <BuildProject>d__58:MoveNext <0x00bf9>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
      at Microsoft.Build.BackEnd.RequestBuilder:BuildProject <0x000ea>
      at <BuildAndReport>d__50:MoveNext <0x0011a>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000fa>
      at Microsoft.Build.BackEnd.RequestBuilder:BuildAndReport <0x000d2>
      at <RequestThreadProc>d__49:MoveNext <0x000da>
      at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000f2>
      at Microsoft.Build.BackEnd.RequestBuilder:RequestThreadProc <0x000ea>
      at Microsoft.Build.BackEnd.RequestBuilder:<StartBuilderThread>b__45_2 <0x00042>
      at System.Threading.Tasks.Task`1:InnerInvoke <0x00069>
      at System.Threading.Tasks.Task:Execute <0x00037>
      at System.Threading.Tasks.Task:ExecutionContextCallback <0x0005b>
      at System.Threading.ExecutionContext:RunInternal <0x001a9>
      at System.Threading.ExecutionContext:Run <0x00042>
      at System.Threading.Tasks.Task:ExecuteWithThreadLocal <0x000f6>
      at System.Threading.Tasks.Task:ExecuteEntry <0x000e8>
      at System.Threading.Tasks.TaskScheduler:TryExecuteTask <0x00043>
      at DedicatedThreadsTaskScheduler:<InjectThread>b__6_0 <0x000c2>
      at System.Threading.ThreadHelper:ThreadStart_Context <0x000aa>
      at System.Threading.ExecutionContext:RunInternal <0x001a9>
      at System.Threading.ExecutionContext:Run <0x00042>
      at System.Threading.ExecutionContext:Run <0x00067>
      at System.Threading.ThreadHelper:ThreadStart <0x00042>
      at System.Object:runtime_invoke_void__this__ <0x000b0>
=================================================================
Abort trap: 6

Steps to Reproduce

Repro Project

Bug Generator critical msbuild MacOS hard

Most helpful comment

We have this issue on the backlog for the current sprint (started yesterday).

All 17 comments

I got similar outcome when running Azure Pipeline on hosted macOS agent

##[section]Starting: Build
==============================================================================
Task         : MSBuild
Description  : Build with MSBuild
Version      : 1.179.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/msbuild
==============================================================================
[command]/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild /version /nologo
[command]/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild /Users/runner/work/1/s/SolutionName.sln /p:Configuration=Release /warnaserror /nowarn:VSTHRD100;VSTHRD200 /v:m /m /bl
Microsoft (R) Build Engine version 16.6.0 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/15.0/bin/MSBuild.dll /bl /m /nowarn:VSTHRD100;VSTHRD200 /p:Configuration=Release /v:m /warnaserror /Users/runner/work/1/s/SolutionName.sln
...
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly. [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: System.IO.IOException: Write fault on path /Users/runner/work/1/s/test/ProjectName/[Unknown] [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.FileStream.WriteInternal (System.Byte[] src, System.Int32 offset, System.Int32 count) [0x00077] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.FileStream.Write (System.Byte[] array, System.Int32 offset, System.Int32 count) [0x00090] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x00080] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.WriteSpan (System.ReadOnlySpan`1[T] buffer, System.Boolean appendNewLine) [0x0016b] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.WriteLine (System.String value) [0x0000d] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.TextWriter+SyncTextWriter.WriteLine (System.String value) [0x00000] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at (wrapper synchronized) System.IO.TextWriter+SyncTextWriter.WriteLine(string) [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.Console.WriteLine (System.String value) [0x00000] in <58e88b8bc3834e07a237b0c4d21c89f2>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Tracing.DefaultListener.WriteToolOutput (System.String message) [0x0000b] in <78b98d4722f1476abe6613ca1bdd4136>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Configuration.ConfigurationLoader.TraceConfigSource (TechTalk.SpecFlow.Tracing.ITraceListener traceListener, TechTalk.SpecFlow.Configuration.SpecFlowConfiguration specFlowConfiguration) [0x0001b] in <78b98d4722f1476abe6613ca1bdd4136>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer (TechTalk.SpecFlow.Generator.Interfaces.SpecFlowConfigurationHolder configurationHolder, TechTalk.SpecFlow.Generator.Interfaces.ProjectSettings projectSettings, System.Collections.Generic.IEnumerable`1[T] generatorPluginInfos, BoDi.IObjectContainer parentObjectContainer) [0x0012b] in <8ab5823da7e34238a921345115cf94d7>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.WrappedGeneratorContainerBuilder.BuildGeneratorContainer (TechTalk.SpecFlow.Generator.Interfaces.SpecFlowConfigurationHolder specFlowConfigurationHolder, TechTalk.SpecFlow.Generator.Interfaces.ProjectSettings projectSettings, System.Collections.Generic.IReadOnlyCollection`1[T] generatorPluginInfos, BoDi.IObjectContainer rootObjectContainer) [0x00000] in <101455c6fb594a1fa73c5f47ed7d2c52>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor.Execute () [0x00049] in <101455c6fb594a1fa73c5f47ed7d2c52>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute () [0x00122] in <101455c6fb594a1fa73c5f47ed7d2c52>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <c2bc54b431de4696887f9375ba0cfe0f>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]
/Users/runner/.nuget/packages/specflow.tools.msbuild.generation/3.7.13/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in <c2bc54b431de4696887f9375ba0cfe0f>:0  [/Users/runner/work/1/s/test/ProjectName/ProjectName.csproj]

@Janek91 please use dotnet build and not monos msbuild to compile on Mac OS

That way I'm not able to build Xamarin projects

What? You still need Monos MSBuild for Xamarin? We weren't aware of that.

Oh, it doesn't also work on Windows with dotnet build. That's interesting.

Yes, .NET 5 doesn't support Xamarin yet

For the runtime, I knew that. We thought that the building of the project would work with dotnet build.

I'm not sure if what you guys are discussing is relevant to my issue actually, but I realized the build fails also for older versions of SpecFlow on Mac, but only if I run the build using msbuild from the command line. In Visual Studio for Mac everything seems to be working fine surprisingly, even the latest 3.7.13 version.

I'm updating details in the issue then about in the description. The bottom line based on my testing is that the last version that worked on Mac with msbuild is 3.1.95 and since version 3.1.97 it stopped working.

To reproduce create sample project with at least one .feature file and run the following from the command line on Mac:

msbuild /t:restore UITests.csproj
msbuild UITests.csproj

Another update: it looks like the last version that was working for us is actually 3.1.89. Even 3.1.95 fails during code generation usually on the CI server, but this is not consistent - occasionally the build will just pass.

Can you guys look into that? We really would like to upgrade to the latest SpecFlow, but because of this issue we are stuck on 1 year old release.

We have this issue on the backlog for the current sprint (started yesterday).

We released a new version of SpecFlow: 3.9.2-beta, where this problem is hopefully solved. Please try it again with the new version:
SpecFlow.NUnit 3.9.2-beta

Can you please release SpecFlow.Plus.LivingDocPlugin beta version as well? I can't test it otherwise.

We will release the non beta 3.9 version of the products within the next days, but I'll keep you updated!
Or you could just comment out/remove the LivingDocPlugin and try to build it for a faster feedback.

Hey @Janek91, we released a new version of SpecFlow (3.9.8) and the LivingDocPlugin (3.9.5), can you please try it?
Let us know if the problem is fixed or not, thanks!

No, there is still something wrong:

SpecFlowFeatureFiles: Features/AccountInfoPage.feature;Features/AccountPage.feature;Features/AccountSettingsPage.feature;Features/AddSubLocationPage.feature;Features/CreateLocationPage.feature;Features/DeviceDetailsPage.feature;Features/DeviceInfoPage.feature;Features/EditAccountInfoPage.feature;Features/EditDeviceDetailsPage.feature;Features/EditLocationDetailsPage.feature;Features/EditSubLocationPage.feature;Features/LocationDetailsPage.feature;Features/LocationInfoPage.feature;Features/LocationsPage.feature;Features/RegisterDevice.feature;Features/StartPage.feature;Features/SubLocationsPage.feature
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly. [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018: System.IO.IOException: Write fault on path /Users/jab/Documents/Repos/SolutionName/test/ProjectName/[Unknown] [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.FileStream.WriteInternal (System.Byte[] src, System.Int32 offset, System.Int32 count) [0x00077] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.FileStream.Write (System.Byte[] array, System.Int32 offset, System.Int32 count) [0x00090] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.Flush (System.Boolean flushStream, System.Boolean flushEncoder) [0x00080] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.WriteSpan (System.ReadOnlySpan`1[T] buffer, System.Boolean appendNewLine) [0x0016b] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.StreamWriter.WriteLine (System.String value) [0x0000d] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.IO.TextWriter+SyncTextWriter.WriteLine (System.String value) [0x00000] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at (wrapper synchronized) System.IO.TextWriter+SyncTextWriter.WriteLine(string) [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at System.Console.WriteLine (System.String value) [0x00000] in <92218043474744ea9d64d27064c35dcb>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Tracing.DefaultListener.WriteToolOutput (System.String message) [0x0000b] in <9c7e9a29b47547ca84af875086ce214a>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Configuration.ConfigurationLoader.TraceConfigSource (TechTalk.SpecFlow.Tracing.ITraceListener traceListener, TechTalk.SpecFlow.Configuration.SpecFlowConfiguration specFlowConfiguration) [0x0001b] in <9c7e9a29b47547ca84af875086ce214a>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer (TechTalk.SpecFlow.Generator.Interfaces.SpecFlowConfigurationHolder configurationHolder, TechTalk.SpecFlow.Generator.Interfaces.ProjectSettings projectSettings, System.Collections.Generic.IEnumerable`1[T] generatorPluginInfos, BoDi.IObjectContainer parentObjectContainer) [0x0012b] in <bcb8f87e66a84149b22fbf4bac375aa0>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.WrappedGeneratorContainerBuilder.BuildGeneratorContainer (TechTalk.SpecFlow.Generator.Interfaces.SpecFlowConfigurationHolder specFlowConfigurationHolder, TechTalk.SpecFlow.Generator.Interfaces.ProjectSettings projectSettings, System.Collections.Generic.IReadOnlyCollection`1[T] generatorPluginInfos, BoDi.IObjectContainer rootObjectContainer) [0x00000] in <a5fb1686afe54d15858eba38119277c5>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor.Execute () [0x00049] in <a5fb1686afe54d15858eba38119277c5>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute () [0x00122] in <a5fb1686afe54d15858eba38119277c5>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <44f29485f7a5471b9b92bd6721e6066e>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]
/Users/jab/.nuget/packages/specflow.tools.msbuild.generation/3.9.8/build/SpecFlow.Tools.MsBuild.Generation.targets(93,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002b9] in <44f29485f7a5471b9b92bd6721e6066e>:0  [/Users/jab/Documents/Repos/SolutionName/test/ProjectName/ProjectName.csproj]

Wait a minute, I just read again the comments here in this issue, and your exception is a different one that we aimed to fix with the 3.9 release (issue of @arek-avanade). Can you please open a new issue with the details? A repro project would be great too!

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