What is the simplest way to run a C# program in linux (eg with `dotnet`) and be able to see the output of Debug.Print statements? All the instructions I find on Google only show how to do this in VS Code and I am not currently using VS Code.
I have to say I already thought C#/.NET was the most search-engine-unfriendly programming language/environment in the world just based on those names, but then in 2015 when Microsoft decided to name a core component "dotnet" was when the unsearchability REALLY went into hyperdrive
Need to look up documentation on how i do a thing in dotnet. No not how I do it in .NET, how I do it in dotnet. If the documentation calls it .NET it's going to be giving me incorrect directions. Only dotnet is okay.

This turned out to be my "simplest" solution! https://wandering.shop/@xgranade/112961883517691345

It does turn out "Debug.Listeners" was renamed to "Trace.Listeners" in .NET CORE so the actual solution is just stuffing these two lines at the top of the program:

var myWriter = new TextWriterTraceListener(System.Console.Out);
Trace.Listeners.Add(myWriter);

Xandra Granade 🏳️‍⚧️ (@[email protected])

@[email protected] Does it work to add System.Console.Out as a trace listener? https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.listeners?view=netframework-4.8.1#examples (I have no idea why the docs keep redirecting to .NET Framework 4.8.1 instead of .NET neé .NET Core.)

The Wandering Shop
@mcc we never really forgave Google for grabbing "go", which is an English stopword
@mcc anyway, we never made this work. sorry :/
@ireneista @mcc They stole it from an older less known programming language too. 🤬
@dalias @mcc so they did. but of course it suddenly had a ton of search juice once it was theirs, which is definitely not the result of anti-competitive practices (sarcasm).

@mcc
I used DuckDuckGo to search:
dotnet core debug.print -"VS code" -"Visual Studio"

The third link was: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-stack

Which led me to:
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/tools-overview?source=recommendations

Which suggests VSCode... but also mentions:
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-sos

Which supposedly supports lldb?

I then used DDG to search:
dotnet core sos debug print

Which led to this blog post:
https://devblogs.microsoft.com/premier-developer/debugging-net-core-with-sos-everywhere/

Good luck!

dotnet-stack diagnostic tool - .NET CLI - .NET

Learn how to install and use the dotnet-stack CLI tool which captures and prints the managed stacks for all threads in the target .NET process.

@djm Thank you very much, this is helpful