News for hackers. Stuff that matters.
Re:Ask HN: Current state of coding .NET code on non-Windows ... by e3bc54b2 on Thursday May 26, 2022 @01:44PM (#31521287)
I only used it for few months as a beginner, so take this as you will.

VSCode works, but JetBrains Rider is probably your best bet. It just works and works really well compared to hodgepodge of extensions in vscode. Beyond these 2, you're pretty much on your own, and things never Just Work.

But, beyond the editor, the ecosystem is not Linux-friendly. A lot of libraries expect and assume you are on Windows and just refuse to work for whatever reason. There are near-zero relevant resources (blog posts, stack-overflow Q/As, forums) for developers on Linux. (I guess this is how Emacs users on Windows feel).

The second paragraph is why I stopped. The .NET core itself is decent, and if you manage to limit use within you should be mostly fine, probably. But the experience never feels home and it is a constant reminder of being second-class that's not my personal favourite way of spending life.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by uticus on Thursday May 26, 2022 @01:52PM (#31521394)
> A lot of libraries expect and assume you are on Windows

I'm curious about this. Can you give an example of a library that refused to work? I'm having trouble imagining what would cause something to break on Linux - but not on Windows - in a typical .NET library or NuGet package.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by CodesInChaos on Thursday May 26, 2022 @04:55PM (#31523246)
MS deprecated Linux support for System.Drawing in .net 6.0 and will remove it in 7.0. https://docs.microsoft.com/en-us/dotnet/core/compatibility/c...
Re:Ask HN: Current state of coding .NET code on non-Windows ... by Kuinox on Friday May 27, 2022 @08:47AM (#31528938)
System.Drawing never worked well on linux, and is mostly used in windows-only gui.

To generate/process images, there are other, great, .NET library like SkiaSharp, or ImageSharp.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by CodesInChaos on Saturday May 28, 2022 @02:09PM (#31542425)
I think there is still a lot of benefit in a first-party library which provides shared abstractions like `Color` and `Bitmap`, even without any fancy manipulation capabilities.
Re:Ask HN: Current state of coding .NET code on non-Windows ... by davidhbolton on Sunday May 29, 2022 @08:59AM (#31548805)
I came across this with System.Drawing on Ubuntu and successfully managed to replace it with SkiaSharp code instead. It was drawing a map for a game in memory then saving to a .jpg file.

I use VS 2022 Community on Windows, tested it there then published to Linux and uploaded over SSH to a VPS. It worked very nicely.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by aaaaaaaaata on Friday May 27, 2022 @09:30AM (#31529392)
So are these mostly documentation/outreach issues, then?
Re:Ask HN: Current state of coding .NET code on non-Windows ... by Kuinox on Friday May 27, 2022 @11:17AM (#31530577)
The documentation of System.Drawing point to these projects:

> If you can't use System.Drawing with your application, recommended alternatives include ImageSharp, SkiaSharp, Windows Imaging Components, and Microsoft.Maui.Graphics

Sadly .NET devs will jump on any first party software and won't look a lot in community alternatives.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by pablok2 on Thursday May 26, 2022 @04:31PM (#31523027)
Everything I write in .NET eventually makes it to a Linux container, I'm not quite writing code in the same environment, but the only difference I've encountered so far is how DateTime works with UTC.
Re:Ask HN: Current state of coding .NET code on non-Windows ... by CodesInChaos on Friday May 27, 2022 @04:09AM (#31527191)
> how DateTime works with UTC

What do you mean by that? I know that the timezone definitions in txdb are not the same as the ones MS uses on Windows, but it doesn't sound like you're talking about that.

Re:Ask HN: Current state of coding .NET code on non-Windows ... by pablok2 on Friday May 27, 2022 @09:13AM (#31529209)
Something about how Linux and Windows using different local times, Linux uses the hardware clock in UTC and then converts, Windows sets the hardware clock to "Local" time adjusted for daylight savings time (https://www.codeproject.com/Questions/533978/C-23plusWINDOWS...)