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

GherkinLanguageServiceFactory ObjectDisposedException when switching branches #182

Open
9 of 36 tasks
PaulFarry opened this issue Mar 12, 2021 · 0 comments
Open
9 of 36 tasks

Comments

@PaulFarry
Copy link

SpecFlow Version:

  • 3.7
  • 3.6
  • 3.5
  • 3.4
  • 3.3
  • 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: 3.6.23

Project Format of the SpecFlow project

  • Classic project format using packages.config
  • Classic project format using <PackageReference> tags
  • Sdk-style project format
<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <PackageReference Include="SpecFlow.MsTest" Version="3.6.23" />
    <PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.6.23" />
  </ItemGroup>
</Project>

.feature.cs files are generated using

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

// SpecFlow Version:3.6.0.0
// SpecFlow Generator Version:3.6.0.0

Visual Studio Version

  • VS 2019
  • VS 2017

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

  • Enabled
  • Disabled (False)

Are the latest Visual Studio updates installed?

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

.NET Implementation:

  • .NET 5.0
  • .NET Core 3.1
  • .NET Core 2.1
  • >= .NET Framework 4.5
  • before .NET Framework 4.5

Test Execution Method:

  • 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.&#x000D;&#x000A;Object name: &apos;GherkinLanguageService&apos;.&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.Implementation.LanguageService.GherkinLanguageService.TextBufferChanged(GherkinTextBufferChange change)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.&lt;&gt;c__DisplayClass8_0.&lt;CreateLanguageService&gt;b__0(Object sender, TextContentChangedEventArgs args) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 58&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
  </entry>

Repro Project

@SabotageAndi SabotageAndi transferred this issue from SpecFlowOSS/SpecFlow Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants