-
Notifications
You must be signed in to change notification settings - Fork 676
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
Omnisharp unit test debugging crashes (MacOS Catalina) #5128
Comments
Thanks for reporting we will investigate. If I am getting it right there is no custom code or libraries used here, just the default code from test template? |
Correct. Thanks for looking into it!
…On Tue, Mar 29, 2022, 11:22 AM Jakub Jareš ***@***.***> wrote:
Thanks for reporting we will investigate. If I am getting it right there
is no custom code or libraries used here, just the default code from test
template?
—
Reply to this email directly, view it on GitHub
<#5128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJK34MPXIOG4JHI6ZHAWK3VCMU33ANCNFSM5R3MOXVA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I have the same issue. Similar to #4021 |
@basvandriel Is the debugger trying to find the assembly in this directory? bin/Debug/net6.0/ref/ Notice the 'ref' in the path. Not sure why it's looking there, as that directory isn't generated on build for me. If you create the 'ref' directory and copy the assembly that you're trying to test into it, the debugger should work. Definitely not an ideal solution however. Hope this gets resolved soon. |
@ahanusa It appears to be failing on the
|
@basvandriel what does your c# log look like? |
@ahanusa The .NET and C# log are both empty. The .NET Test Log contains the following;
|
Has any progress been made on this issue? This bug is pretty crippling to my workflow :( |
Any progress? I got a similar issue on ubuntu 22.04 (on 20.04 too), using .net5 and xunit 2.4.2-pre.12:
|
Same here :( |
I've been experiencing this as well. It's crippling my C# workflow on macOS on a .NET 6 project. I wish I knew how to fix this. |
I've been using Visual Studio for Mac solely for UT debugging purposes. It works just fine. However, having 2 editors/IDEs open for different purposes is hugely annoying. |
I solved my problem on Ubuntu by uninstalling dotnet sdk for good and following this article: https://docs.microsoft.com/pt-br/dotnet/core/install/linux-ubuntu#2004- After a clean installation, omnisharp works fine and finally i could debug XUnit tests! Hope this helps anyone |
I'm using macOS. Pretty frustrating that there has been zero traction on this. I originally posted 1.5 months ago. |
I primarily do .NET development on macOS and exclusively in vscode so this affects me a lot. I just tried my workflow using a vscode dev container. This bug appears there as well. The dev container image is Debian based and is from Microsoft. Can't really uninstall and reinstall it there to fix it. |
@ahanusa If you do create the "ref" folder and move the dll-s and other stuff there, the the debugger works :) |
Yes, I have already mentioned that previously, however, I refuse to copy and paste binaries to that folder every time I do a build. I also don't feel like creating a script to do it for me as I have 20 projects in my solution. |
I am hitting this as well. Doing some digging, it looks like we're trying to get the version from dotnet and then reporting the error here: This is with useModernNet set to true. |
I just tested this with the pre-release https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.25.0 No luck. However, I was able to find a work around, I had a global.json in the test directory setting:
Renaming that file made it start working. |
@chamons Thanks for sharing your finding about you global.json. If I have a project folder and add a global json requiring a version of the SDK that is not installed I see the following:
This, of course, will not parse as a semantic version and OmniSharp should add some special handling (or error message) for this case. |
Hi all, Debugging in vscode started working for me again. I've tested on macOS and in a Linux container. This might have been accidentally fixed. Can a few other people verify? |
Closing due to lack of activity. |
Please paste the output from your clipboard## Issue Description ##
Steps to Reproduce
This behavior started immediately after installing dotnet 6 SDK via
brew upgrade dotnet-sdk
, which installed SDK 6.0.21From command line:
❯ mkdir Testing
❯ cd Testing
❯ dotnet new sln
❯ dotnet new classlib -n TestingLib
❯ dotnet new xunit -n TestingTests
❯ dotnet sln add TestingLib
❯ dotnet sln add TestingTests
❯ cd TestingTests
❯ dotnet add reference ../TestingLib
❯ cd ..
❯ code .
Next, add a public function to TestingLib.Class1
New up an instance of Class1 in TestingTests.UnitTest1.Test1()
Set a breakpoint, hover over method, click
Debug Test
Expected Behavior
The breakpoint to hit
Failed to start debugger error
Actual Behavior
Logs
OmniSharp log
Starting OmniSharp server at 3/28/2022, 8:10:54 AM
Target: /Users/AHanusa/work/Testing/Testing.sln
OmniSharp server started.
Path: /Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/run
PID: 13729
Starting OmniSharp on MacOS 10.15.7 (x64)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.1.0 - "/Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 17.1.0 - "/Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/AHanusa/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.1/omnisharp/.msbuild
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/AHanusa/work/Testing'.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Skip loading projects listed in solution file or under target directory because MsBuild:LoadProjectsOnDemand is true.
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/AHanusa/work/Testing'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/AHanusa/work/Testing' on host 13700.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/AHanusa/work/Testing/TestingTests/TestingTests.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/AHanusa/work/Testing/TestingTests/TestingTests.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/AHanusa/work/Testing/TestingTests/TestingTests.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/AHanusa/work/Testing/TestingTests/TestingTests.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: TestingTests
info: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj
info: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Update project: TestingLib
info: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /usr/local/share/dotnet/sdk/6.0.201/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
info: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /usr/local/share/dotnet/sdk/6.0.201/Sdks/Microsoft.NET.Sdk/analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll
info: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.3/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.dll
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /Users/AHanusa/work/Testing/TestingTests/UnitTest1.cs, Line: 0, Column: 0.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Update project: TestingLib
Received response for /v2/getcodeactions but could not find request.
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 35,
"Command": "/v2/debugtest/getstartinfo",
"Arguments": {
"FileName": "/Users/AHanusa/work/Testing/TestingTests/UnitTest1.cs",
"MethodName": "TestingTests.UnitTest1.Test1",
"TestFrameworkName": "xunit",
"TargetFrameworkVersion": ".NETCoreApp,Version=v6.0",
"NoBuild": false
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (2564.9937ms) ************
{
"Request_seq": 35,
"Command": "/v2/debugtest/getstartinfo",
"Running": true,
"Success": false,
"Message": ""System.InvalidOperationException: The debugger could not be started\n at OmniSharp.DotNetTest.Services.DebugTestService.Handle (OmniSharp.DotNetTest.Models.DebugTestGetStartInfoRequest request) [0x00050] in <5e135b77c1bc4c358e7d29f74c6eda4e>:0 \n at OmniSharp.Endpoint.Exports.RequestHandlerExportHandler
2[TRequest,TResponse].Handle (TRequest request) [0x00000] in <f325be76f3664621aaf9ae7e6a5789dd>:0 \\n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler2[TRequest,TResponse][] handlers, TRequest request) [0x00022] in <f325be76f3664621aaf9ae7e6a5789dd>:0 \\n at OmniSharp.Endpoint.EndpointHandler
2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in :0 \n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in :0 \n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000f3] in <53cdc2cf95d3416bbae3409faa4eb825>:0 "","Body": null,
"Seq": 4305,
"Type": "response"
}
C# log
NOTE: From .NET Test Log Notice the ref in the path below. If I create a bin/ref directory and copy the TestingLib.dll into it, the debugger works appropriately.
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error MSB3883: Unexpected exception: [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : DirectoryNotFoundException: Could not find a part of the path '/Users/AHanusa/work/Testing/TestingLib/bin/Debug/net6.0/ref/TestingLib.dll'. [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func
2 errorRewriter) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj] /usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func
2 errorRewriter) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : at Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly.Copy() [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
/usr/local/share/dotnet/sdk/6.0.201/Microsoft.Common.CurrentVersion.targets(4650,5): error : [/Users/AHanusa/work/Testing/TestingLib/TestingLib.csproj]
Environment information
VSCode version: 1.65.2
C# Extension: 1.24.1
Mono Information
OmniSharp using built-in monoDotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.201 Commit: ef40e6aa06Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.201/
Host (useful for support):
Version: 6.0.3
Commit: c24d9a9c91
.NET SDKs installed:
6.0.201 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: