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.
@mcc non-committal answer: I think you can `dotnet build path/to/dir/containing/the/sln/file` the thing and just run it? Fuck, I don't know what sort of control the output log levels or whatever.
@onelson Debug.Print isn't a "log level". It sends information to an attached debugger, and if no debugger is attached it is a noop
@mcc what the fuck, geez
@onelson Microsoft ¯\_(ツ)_/¯
@mcc I would simply give up
@onelson I mean seriously the answer is probably going to be "just fuck off, and ask Christine to run it tomorrow on her Windows machine, where this stuff is set up"
@mcc I mean, I think VS Code is something you can get pretty trivially. I don't know what sort of baggage there is to do dotnet stuff in there. If it were Visual Studio (non-Code) I'm assuming it's all greased lightning.

@onelson I have vs code on this machine but there's an awkward issue where we've already got separate, unique vs code execution scripts set up for Windows and Mac hosts and this raises the question of (1) will the Mac launch.json simply work on linux? (2) will the Mac launch.json need modification to work on Linux? (3) will the Mac launch.json do something *subtly but silently wrong*, such as misinvoke msbuild prebuild steps, on Linux?

Simple to test but simpler to ask Christine to test it!

@mcc Yeah, I agree. Christine is the fix.

@mcc @onelson What does your *.csproj look like?

is OutputType "Exe" or "WinExe"?

I just use System.Console.WriteLine in a pinch, but that only works for "WinExe" as I understand it...

I'd test more but pretty sure you're already getting feedback from Christine at this point.

@mcc @onelson not quite a noop, it goes to syslog
https://github.com/dotnet/runtime/blob/b1968e7aa8d56a088e8be6817d5240fb345f901c/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Unix.cs#L48

e.g.
`Debug.WriteLine("this is some output " + DateTime.Now.ToString(), "foo");`

`$ tail -F /var/log/syslog`
...
`Aug 14 14:38:29 sandsys dotnet_hell: foo: this is some output 2024-08-14 2:38:29 p.m.`

runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.Unix.cs at b1968e7aa8d56a088e8be6817d5240fb345f901c · dotnet/runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps. - dotnet/runtime

GitHub
@mcc @onelson (with just a regular `dotnet run` of a `dotnet new console` project with nothing else special)
@rakslice @onelson D: this might actually be worse than doing nothing
@mcc @onelson absolutely, but it 100% fits with the Microsoft mentality about this sort of stuff
@rakslice @mcc you can send the logs to dmesg by editing a key in the linux registry

@onelson @mcc "editing a key in the linux registry" alol.

but to be serious, it's syslog output so a variety of syslog implementations are available and most of those you can configure to deliver different categories of output a variety of different ways to different targets (e.g. different files, devices, etc.) or not