Could not load .NET Core dbgshim library when launching debugger

Hi,
I get this error when trying to debug a .net core console app

~> Process RedisConsoleApplication started
~> The process failed to start with the following error: Could not load .NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/libdbgshim.dylib

Cheers,
John

The file looks to be there

/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/libdbgshim.dylib
-rwxr-xr-x 1 root wheel 315420 Nov 15 10

an I see this in console

parameters {
“SubMode”: “.NETCore”,
“EnvironmentVariables”: {
},
“Arguments”: [
],
“WorkingDirectory”: “/Users/JohnMoshakis/Documents/develop/Echoes/Core/RedisConsoleApplication/Bin/Debug”,
“Architecture”: “x86_64”,
“CaptureOutput”: true,
“NetCoreRuntimeVersion”: “3.1.0”,
“MonoExePathOverride”: “/Applications/Fire.app/Contents/Resources/Mono/bin/mono-sgen”,
“UseMonoDebugger”: false,
“NetCore”: true,
“StrictBreakpoints”: false,
“CrossBox”: “Local”,
“DebuggerExePathOverride”: “/Applications/Fire.app/Contents/Resources/RemObjects.Elements.Debugger.exe”,
“Mode”: “Echoes”,
“LocalExecutable”: “/Users/JohnMoshakis/Documents/develop/Echoes/Core/RedisConsoleApplication/Bin/Debug/RedisConsoleApplication.dll”,
“RemoteExecutable”: “/Users/JohnMoshakis/Documents/develop/Echoes/Core/RedisConsoleApplication/Bin/Debug/RedisConsoleApplication.dll”,
“NETCoreRuntime”: “Microsoft.NETCore.App”
}

I also tried 3.1.3 as well but that has the same issue.

What build is that with?

The latest, 2501

Curious. seems stat they have moved around stuff for 3.1 again. Sigh :(. I’ll need to investigate tomorrow. 3.0 is worming ok, though?

Thanks, logged as bugs://84177

It still seems to want to use /usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/libdbgshim.dylib

even though I have runtime, sdk and target framework set to 3

Hm, yeah, that makes sense, because ASP.NET Core, in Microsoft’s infinite wisdom, doesn’t ship the debugshim, only .NET Core does. So what we do iOS when the project is set to ASP.NET Core, we use the .NET Core version. But (in case anyone is shocked) the versions for .NET Core and ASP.NET Core don’'t (always) match exactly, so we can’t pick the version of .NET Core the matches the selected ASP.NET Core version; we pick the latest.

Did I mention what a mell from hell MS is making out of .NET, with Core? :frowning:

Afraid this will have to wait for my fix (or you need to uninstall 3.1, I that’s possible). sorry.

FTR, 3.1.0-preview3.19553.2 still has/had that file where we expected it; installing final 3.1.201 now…

Hmm, that gives me a 3.1.3 folder (not 3.1.0, or 3.1.201 — because, why not, I guess? :woman_shrugging:t3:) and that one still has libdbgshim.dylib… :frowning:

I was tempted to install the preview of 5, to see what new nightmares that would bring :slight_smile:

And, I can run/debug fine with this one:

Do you have a 3.1.0 folder, and is it missing that dylib, or don’t you have that folder at all?

If not, what version folders do you have in

/usr/local/share/dotnet/shared/Microsoft.NETCore.App/
and
/usr/local/share/dotnet/shared/Microsoft.ASPNETCore.App/

?

:scream:

The file is there

Johns-Mac-mini:~ JohnMoshakis$ ls -l /usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.3/libdbgshim.dylib
-rwxr-xr-x 1 root wheel 837376 Mar 18 18:05 /usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.3/libdbgshim.dylib

Taking one for the team, I just did that (for one, I don’t need Core for production work, so I care less if It breaks me completely; for another, this gives me a chance to improve support for using a lower version than the max installed ;), and shockingly, it works:

(ignoring the socket in use; looks like my previous instance didn’t shut down correctly; happens).

Is it possible to get more info about why it couldnt be loaded ?

As you installed 5 Im going to as well :slight_smile:

because it’s not there :wink:

ah, hm, no, I misremembered the code; looks like w don’t actually check if the file’s there, tis is from LoadLibrary (and I missed the message where you said the file is there).:

        if not fDict.TryGetValue(aPath, out result) then begin
          var lLib := LoadLibrary(aPath);
          if lLib = IntPtr.Zero then
            raise new Exception($"Could not load .NET Core dbgshim library at {aPath}");

I don’t think there’s a way to get more details out of this tough… :(. I will add an extra check/message for the missing file, som we can ell tr two scenarios apart in the future.