3

Currently I am trying to debug a Linux .NET Core application under Linux.

The trouble is, it fails somewhere right in the beginning, and I cannot get where. Logging is impossible under current circumstances.

As far as I can see on the Internet, and (severely avoiding any kind of systematizedness and consequtiveness) on MSDN specifically, the only currently available options for Linux are:

  1. debug remotely (would not do well in my case);
  2. Rider EAP by Jetbrains (proprietary decision);
  3. using lldb.

So, my questions are:

  1. Is there any way to launch the .NET Core self-contained app (via the "dotnet Some.dll" command) in such a way that it instantly breaks (i.e. as if there was a breakpoint) at the entry point?
  2. If not, how can one launch lldb for a .NET Core console application attached (since numerous examples and issues over the Internet all show attaching to the already-running .NET Core process)?
  3. Once again, there is the dotnet-dump utility, which works with already-running processes as well - so that, even dumps are an unavailable ooption for processes that crash almost instantly. I expected there might have been ways to make it dump like (imaginary) "dotnet-dump collect SomeInvocation.dll" along with (actully existing) "dotnet-dump collect --process-id 1234". Is there such a way?
3
  • How did you end up solving this? Commented Jul 22, 2020 at 18:17
  • Could not find any solution yet ;d Still, there are tools (NOT debuggers), that might help, like AvaloniaILSpy (fork of ILSpy, built with cross-platform AvaloniaUI) Commented Jul 23, 2020 at 15:19
  • To use lldb to run the .NET code, start lldb, then inside type the following 3 commands (I've separated them by | since this is a comment): target create dotnet | settings set target.run-args <path-to-assembly> | r Commented May 8, 2021 at 19:52

0

Browse other questions tagged or ask your own question.