Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings
[ ] Enabled
[X] Disabled (False)
Are the latest Visual Studio updates installed?
[X] Yes
[ ] No, I use Visual Studio version <Major>.<Minor>.<Patch>
.NET Implementation:
[ ] .NET 5.0
[X] .NET Core 3.1
[ ] .NET Core 2.1
[ ] >= .NET Framework 4.5
[ ] before .NET Framework 4.5
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
(no file)
Issue Description
When you switch between branches with a feature file open, then visual studio presents an object disposed exception in the info area above the code editor.
Steps to Reproduce
If you are on a branch and have a feature file open
switch branches where the same feature file has changed
you get the folowing error in the visual studio log
<entry>
<record>1961</record>
<time>2021/03/12 02:40:30.664</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GherkinLanguageService'.
 at TechTalk.SpecFlow.VsIntegration.Implementation.LanguageService.GherkinLanguageService.TextBufferChanged(GherkinTextBufferChange change)
 at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.<>c__DisplayClass8_0.<CreateLanguageService>b__0(Object sender, TextContentChangedEventArgs args) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 58
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)
--- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
</entry>
SpecFlow Version:
Used Test Runner
Version number: 3.6.23
Project Format of the SpecFlow project
packages.config
<PackageReference>
tags.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation
NuGet packageSpecFlowSingleFileGenerator
custom tool// SpecFlow Version:3.6.0.0 // SpecFlow Generator Version:3.6.0.0
Visual Studio Version
Enable SpecFlowSingleFileGenerator Custom Tool
option in Visual Studio extension settingsAre the latest Visual Studio updates installed?
<Major>.<Minor>.<Patch>
.NET Implementation:
Test Execution Method:
<SpecFlow> Section in app.config or content of specflow.json
Issue Description
When you switch between branches with a feature file open, then visual studio presents an object disposed exception in the info area above the code editor.
Steps to Reproduce
If you are on a branch and have a feature file open switch branches where the same feature file has changed
you get the folowing error in the visual studio log
Repro Project