vscode-csharp: Debugger Fails to start when attempting to debug test
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.1
VS Code version:
1.11.2 & 1.12.0
C# Extension version:
1.9.0
The following lines are in my .csproj
files as well:
<TargetFramework>netcoreapp1.1</TargetFramework>
<DebugType>portable</DebugType>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
Steps to reproduce
- Create an test class using xunit with a test
public class UnitTest {
[Fact]
public void TestFoo()
{
Assert.True(false, $"{nameof(TestFoo)} was run.");
}
}
- Place a breakpoint
- Click the “Debug Test” CodeLens link
Expected behavior
The debugger launches, PDBs are loaded, and VSCode hits a breakpoint.
Actual behavior
The first time, the debugger loads, but no PDBs are loaded so VSCode never hits a breakpoint.
The second time, the debugger fails to load and VSCode presents the message: “Failed to start debugger: null”
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 90 (57 by maintainers)
It’s OK. Thank you for providing that simple project to help us repro. Hopefully we’ll be able to get you some private bits to try.
I don’t think I fixed it by accident, but I’d be happy if that were the case. 😄
@fedoranimus: I’m curious to know if the latest update (1.10) fixed the issue for you.
Sorry if this is obvious, but I wrote up some instructions: https://github.com/OmniSharp/omnisharp-vscode/wiki/Diagnosting-"Debug-adapter-process-has-terminated-unexpectedly"
[EDIT]: please disregard since Dustin provided the crash report, and anyway the repro project reproduced the crash for Dustin anyway.
Here’s the fix for that package restore issue: https://github.com/OmniSharp/omnisharp-roslyn/pull/861.
Here it is working on my Windows box as proof that it can work. 😄
I’ll try my Mac tomorrow.
OK. I can repro.
Thanks @fedoranimus! From your log, it looks like things are working as expected up until we tell the test process that the debugger has launched it and it’s time to actually run the test.
This is identical to the behavior I saw in a log that @eamodio sent me. That’s at least some evidence that you two are experiencing the same issue.
I’m seeing the same issue as @StephenRedd when I debug a second time. This occurs only a couple seconds after I click the CodeLens link.
Yeah, so something’s failing before the debug session kicks off. 5 minutes is a pretty long time.
I’m going to planning to push out the first beta of our 1.10 release later today, which should have more reporting during that time when you’re just waiting. Hopefully that will reveal something.
I’ll test waiting a while before trying to launch the test as well and capture the log, but generally speaking I have waited a while. If you take that log above, wait on the same system for 5 minutes, then click debug again here is what the next messages will look like: