Omnisharp-vscode: VSCODE "debug test" throws error saying "Failed to start debugger: "System.InvalidOperationException"

Created on 13 Nov 2018  路  1Comment  路  Source: OmniSharp/omnisharp-vscode

Environment data

dotnet --info output:
.NET Core SDK (reflecting any global.json):
Version: 2.1.402
Commit: 3599f217f4

Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
RID: ubuntu.14.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.402/

Host (useful for support):
Version: 2.1.4
Commit: 85255dde3e

.NET Core SDKs installed:
2.1.402 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

VS Code version: 1.28.2
C# Extension version: 1.17.0

Steps to reproduce

I am using MsTest for unit testing. Debugging was working fine. Suddenly started getting issue. When i restart the omnisharp and VSCODE and click debug test it just stuck and nothing happens. When i click again after some time it throws error.

Expected behavior

I should be able to debug a single test.

Actual behavior

At first click it just got stuck and at second click it throws following error message

Failed to start debugger: "System.InvalidOperationException: Debug session already started.n at OmniSharp.DotNetTest.DebugSessionManager.VerifySession (System.Boolean isStarted) [0x00055] in <55a5c1daee14484c9b080078d007b350>:0 n at OmniSharp.DotNetTest.DebugSessionManager.StartSession (OmniSharp.DotNetTest.TestManager testManager) [0x00011] in <55a5c1daee14484c9b080078d007b350>:0 n at OmniSharp.DotNetTest.Services.DebugTestService.Handle (OmniSharp.DotNetTest.Models.DebugTestGetStartInfoRequest request) [0x00015] in <55a5c1daee14484c9b080078d007b350>:0 n at OmniSharp.Endpoint.Exports.RequestHandlerExportHandler2[TRequest,TResponse].Handle (TRequest request) [0x00000] in <7c7bd18e4e204103b0b1dc6c6b472d7d>:0 \n at OmniSharp.Endpoint.EndpointHandler2+d__18[TRequest,TResponse].MoveNext () [0x0008a] in <7c7bd18e4e204103b0b1dc6c6b472d7d>:0 n--- End of stack trace from previous location where exception was thrown ---n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0 n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0 n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0 n at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <b0e1ad7573a24fd5a9f2af9595e677e7>:0 \n at OmniSharp.Endpoint.EndpointHandler2+d__16[TRequest,TResponse].MoveNext () [0x0024b] in <7c7bd18e4e204103b0b1dc6c6b472d7d>:0 n--- End of stack trace from previous location where exception was thrown ---n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0 n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0 n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0 n at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in :0 n at OmniSharp.Stdio.Host+d__13.MoveNext () [0x0010d] in :0 "

Most helpful comment

@mubarik How did you resolve this issue?

>All comments

@mubarik How did you resolve this issue?

Was this page helpful?
0 / 5 - 0 ratings