Unable to execute Debug Test (specific scenario)
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (2.1.105)
Product Information:
Version: 2.1.105
Commit SHA-1 hash: 141cc8d976
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.105/
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11
VS Code version: 1.23.1 C# Extension version: 1.15.0
Steps to reproduce
We’ll need a project with subprojects referenced in .csproj
with $(MSBuildStartupDirectory)
. The project above demonstrates this scenario:
https://github.com/pfrozi/project-levels-test
- Debug any test via code lens (clicking on “debug test” above the method on UnitTest.cs).
Expected behavior
Debugger goes into the first breakpoint of a test method.
Actual behavior
Failed to start debugger: "System.NullReferenceException: Object reference not set to an instance of an object
at OmniSharp.DotNetTest.TestManager.SendMessage[T] (System.String messageType, T payload) [0x0002d] in <33736a65aede4474bfe8b27847decd0c>:0
at OmniSharp.DotNetTest.VSTestManager+<DiscoverTestsAsync>d__12.MoveNext () [0x0003f] in <33736a65aede4474bfe8b27847decd0c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at OmniSharp.DotNetTest.VSTestManager+<DebugGetStartInfoAsync>d__8.MoveNext () [0x0008c] in <33736a65aede4474bfe8b27847decd0c>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at OmniSharp.Endpoint.EndpointHandler`2+<HandleSingleRequest>d__18[TRequest,TResponse].MoveNext () [0x000e4] in <60d55a57d20c497d81259dcc806d3c60>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at OmniSharp.Endpoint.EndpointHandler`2+<Process>d__16[TRequest,TResponse].MoveNext () [0x0024b] in <60d55a57d20c497d81259dcc806d3c60>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <64d3ed9d91d947acb3a1d9bc1953eb73>:0
at OmniSharp.Stdio.Host+<HandleRequest>d__15.MoveNext () [0x0010d] in <f2607bf9829a436d80af1306ea7ea2cd>:0 "
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Can't run or debug unit tests - Visual Studio Feedback
I'm using Visual Studio Community Edition 15.8.1 and I can't run or debug any unit tests. Every time I'm trying to run the...
Read more >Debug Tests Fails with "Multiple scenarios are not supported"
A 'Debug Test' only supports running with one engine. When executing a test, each scenario defined requires its own dedicated engine, which means...
Read more >Visual Studio - suddenly cannot debug tests - Stack Overflow
Solution: Select 'Debug Unit Tests' or 'Run Unit Tests' instead of 'Debug Tests' or ' ...
Read more >Unable to run/debug unit tests · Issue #3313 · microsoft/PTVS
I consistently run into issues while debugging unit tests where: The test will either continue to run after it's been cancelled or has...
Read more >Debug unit tests with Test Explorer - Visual Studio (Windows)
In the Visual Studio editor, set a breakpoint in one or more test methods that you want to debug. Note. Because test methods...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pfrozi I used the git submodule update and cloned the two submodules. But I am certain now that there is a problem with the references here. The tests use the project-level1 project but the reference to them is not present in the csproj. I resolved all the necessary references with absolute paths and everything is working fine for me now. Could you try that ?
@pfrozi Glad you got it working 😃