5 ms·
.NET on Linux: What a Contrast
- Doches 3y agoNot just JetBrains: surely Unity has been another strong driver of cross-platform .Net use. If nothing else it’s certainly provided a reason to use C# for folks not coming from a Windows platform app developer background! Certainly for me C# is “the Unity language.” I’m dimly aware that it has some vague Microsoft association, but I don’t think I’ve even seen a piece of MS tooling for it in…many years. Unity + JetBrains Rider has been a pleasant gamedev environment.
- TillE 3y agoUnity is definitely a huge reason that C# has continued to grow outside the enterprise-y space. It's unfortunate that they're still stuck on their old fork of Mono, because Microsoft's tooling (and their runtime) is really good. You can write a C# game in Godot now and seamlessly use the Visual Studio debugger without any janky plugin.
- ClimaxGravely 3y agoHave you had trouble debugging unity with VS in the past? I can't recall ever having any issues personally.
- qwytw 3y ago> stuck on their old fork of Mono Didn't they switch to .NET Core years ago? Of course for many platforms you have to use their CPP transpiler which complicates some things that might be possible in normal C#.
- gentleman11 3y agoOur project is .net 2. You can opt for .net 4 but there are issues that come up and we don’t want that headache until things become smooth
- NekkoDroid 3y agoTo clarify: what you are talking about is .NET Standard 2.X and .NET Framework 4.X Unity currently does not support .NET (Core) at all.
- chrisdirkis 3y agoThey're in the process of swapping out their Mono fork for a modern Core fork, which I believe they're planning on upstreaming changes to too. A few years ago, someone demonstrated a 1-week hackathon version of a game build running on Core, and recently (2023-12), someone on the forum noted that they have an internal Editor running on Core. Most modern large games use IL2CPP, the C++ transpiler; it's a requirement on iOS, nearly a requirement on Android, and almost certainly a requirement on consoles. Perf is often nicer and it's harder to mod/hack, which some devs like. Sibling poster notes different .Net compatibility settings. Modern Unity versions allow you to be in either .Net 4.6(ish) mode or .Net Standard 2.0/2.1 mode. The latter comports more with Core's APIs, though is pretty old at this point. And, since we're on similar topics, Unity currently supports C# 9.0, minus a few minor features[1]. This is a massive improvement compared to a few years ago, where we were stuck with C# 4 or 6, and means you can write pretty modern and performant C#. Especially notable is Span support, a way of representing (basically) non-owning array slices. [1] https://docs.unity3d.com/2023.3/Documentation/Manual/CSharpCompiler.html https://docs.unity3d.com/2023.3/Documentation/Manual/CSharpC...
- sanktanglia 3y agoFunny enough moving to il2cpp made it even easier to hack/mod/access since now all class info and offsets and other info are exposed, easily with full type info. I'm just about done with a lib that can fully read all of the il2cpp related data externally, it's been a fun project
- pjmlp 3y agoUnity is the only reason C# has been seriously taken by the game development community, after internal politics killed Managed DirectX and XNA. Nowadays DirectX team doesn't even bother to shy away from it, it is up to Unity or other third parties to provide bindings to .NET. Compare this with Swift bindings to Metal, or Java ones to OpenGL ES (Android might also get WebGPU bindings to Java, lets see what Android 15 brings).
- chrsw 3y agoCan one .NET GUI application look and feel native on Windows and Linux?
- generichuman 3y agoDepends on what GUI library you're using, same as every other programming environment. There's GTK Sharp for C#.
- jiggawatts 3y agoYes, but the portable GUI frameworks by Microsoft themselves are generally not very good, and they tend to be abandoned after a couple of years. Avalonia is developed outside of the Microsoft corporate madness and seems to be slowly becoming the defacto cross-platform framework because it is expected to last a bit longer than a manager's attention span: https://avaloniaui.net/ https://avaloniaui.net/
- FirmwareBurner 3y agoThat's rich considering that many of the new Windows apps shipped out of the box with Windows 11 are web based and use some sort of Edge based Electron-like container.
- wvenable 3y agoMost new Microsoft apps are actual web apps that run a browser and then on the desktop they're just the same app in an Edge-Electron-like container.
- reactordev 3y agoI think that corroborates that GUI development on .net is a mess and the only common framework out there that can solve the “do it once on all the things” is Avalonia. Web-based electron apps are not .net apps and that’s what we are talking about here.
- justin66 3y agoHow does what you're talking about suggest the parent comment is "rich?"
- asabla 3y agoIt has taken .net and Microsoft a long time to get to this point. But I do feel we're in a really good state for .net development. I do agree what kqr mentions in the blog post, that the state of .net wasn't really that great during the core era (especially during 1-3). But after hitting .net core 3.1 things really took a turn. And now with .Net 8 (note that core is not part of the naming anymore), things are looking great. The two things which lags behind in both experience and is still UX related. MAUI was meant to be this super cool new UX tech, which would save us from electron. But it never happen, and may never do it in the future either. The second one is Blazor. It's such a mixed bag of what the experience is. Sometimes it's so seamless and nice...and then you hit some weird LSP stuff and away goes type checking, hinting and syntax highlighting. But there is hope ig guess. If you're interested in writing C# and .Net code on a Linux machine. Then wait no further. VS Code (with .Net dev kit extension) works great. And if you're like (which prefers neovim), things are pretty good as well. Just don't expect to have a good experience with razor pages and/or blazor (when using Neovim instead of VS Code).
- generichuman 3y ago> If you're interested in writing C# and .Net code on a Linux machine. Then wait no further. VS Code (with .Net dev kit extension) works great. Unless you're writing Roslyn source generators. You can only debug them with (non-code) Visual Studio on Windows in my experience. Rider does not work well either.
- ygra 3y agoYou can probably attach to the compiler process with any debugger. Even just hitting F5 in VS didn't do the expected thing as it ended up debugging devenv.exe instead of VBCSCompiler.exe (the Roslyn analysis process). But if Rider (or VS Code) can attach to other processes, you should be able to debug your analyzers (and source generators).
- throw__away7391 3y agoMy experience is that Rider works much much better (on Mac) for source generators than Visual Studio did on Windows. In particular it handles changes without reloading the solution far better than VS. I should probably add I have never used Rider on Windows, could be different there.
- politelemon 3y ago> Today, I still write .net code (for a different employer) and I can barely tell whether I’m on Windows or Linux. One of the most interesting and nicest outcomes of this has been wsl2, which has made Linux development in enterprises available, and palatable to policies and security requirements. While keeping that nice seamless experience. Without it my only choices were a mediocre experience directly on windows with its odd choices, or a mediocre experience with "we have UNIX at home" on macos with its handwaved away deficiencies.
- rr808 3y agoI'm curious how many corporates allow WSL2. I've worked for two since it was released and neither permitted it. I guess virus scanning is too hard?
- aninteger 3y agoThey have attempted to remove it here but Docker really works much better when WSL2 is present (or maybe Docker and WSL2 share the same technology underneath). My employer has been trying to remove docker as well but it's sort of a requirement for development.
- rr808 3y agoyeah no docker for us.
- asp_hornet 3y agoThis is an interesting take considering Microsoft's entire ecosystem feels like "we have open source at home"
- tracker1 3y agoI think WSL2 makes Windows far more tolerable. The VS Code remote development extensions integrated nicely and docker+compose is a treat to be sure. I'm not sure I could go back to using Windows without it... I'm fine running Mac or Linux though.
- munchler 3y agoI think VSCode is a big part of the story here. Having a Microsoft IDE that works on Linux makes it much easier to develop portable .NET code.
- sremani 3y ago.net development on VSCode is not a good story. C# Devkit may change it but Omnisharp was not such a successful story.
- bjconlan 3y agoAbsolutely, I've fallen in love with F# using Ionide (vscode extension(s)) on Linux. MS have really come a long way (I would say I would take a good long hard look at .net 8 before picking up my go-to tooling (java/spring dev speaking here)
- npalli 3y agoWhat is the latest story of native UI's with .NET. There is always some half baked stuff going on and abandoned all the time.
- jjice 3y agoThe latest is MAUI, which seems to take a Dart/Flutter like approach.
- npalli 3y agoAs usual, the true test of whether something will stick is what apps/tools is Microsoft building with MAUI? If nothing, then good chance it is a yet another framework thrown at developers and abandoned five years later.
- DANmode 3y agoDoes this take anything away from the rest of .NET? Serious question.
- JamesSwift 3y agoWhy do you think it is similar to Dart/Flutter? MAUI is basically a dolled-up Xamarin, but catered to .net 6+ (which has the ios/android toolchains as first party TFMs so it makes it much nicer to organize projects in some ways). It also comes with a slew of new bugs : )
- ThinkBeat 3y agoI love Delphi which still allows a developer to quickly put together a UI with drag and drop and point and click. Run it on Mac,Linux,Windows. They have had all this working for over a decade. If only the madness of post Borland had not been so complete.
- zeroc8 3y agoTo me, Delphi has always been the best tool for desktop development. And I've tried them all. Win32, MFC, Winforms, WPF, Qt, Gtk, WxWidgets, Fltk, Swing, JavaFX, Flutter, React, Angular, Svelte, Solid... But desktop development is dead, unfortunately. And Delphi is too expensive. They should take a look at Jetbrains on how to successfully sell licenses to individuals...
- ThinkBeat 3y agoWell Borland knew who to sell licenses to individuals. Turbo Pascal and the rest of that line sold extremely well. That was true for Delphi as well in the beginning. Unfortunately, some giant idiotic enterprisy choices were made at a corporate level, setting off a sequence of disasters. A true tragedy in slow motion of decades.
- pjmlp 3y agoAlongside C++ Builder, except for Borland, no one else has managed to create such a great product for doing GUI development in C++, bringing it closer to the Delphi/VB experience. C++/CLI and C++/CX never had that kind of support on Microsoft, even though they get associated with having pushed C++ on the industry (ironically given that it is a Bell Labs UNIX born language, and they were the last PC compiler vendor to support it). Even MFC never was as good as OWL/VCL.
- _8j50 3y agoI recently was dumbfounded when seeing asp.net in GKE. Are they running windows in k8s? How? Nope...just .NET in linux containers. I was similarly confused by desktop linux apps throwing .NET exceptions.
- tracker1 3y agoThe tooling for .Net in Linux and Docker has gotten pretty good. Also, Avalonia and Uno are both pretty decent options. I'm not expressly opposed to electron like some, but I think efforts closer to native should be made more often.
- e12e 3y agoDon't forget that there have been native Linux builds of Microsoft SQL server for a long time - along with (Linux) docker images.
- VikingCoder 3y agoI run a $5 a month Linode with code-server on it, and use Tailscale to access it, and Tailscale Funnel to publish a web server on it. I'm kind of happy as a clam. I know that MS Visual Studio is a lot nicer for C# development. But yeah, I'm really enjoying having this cloud code environment available from anywhere.
- snapplebobapple 3y agoUpgrade to the 17 dollar a year racknerd vps for additional happiness
- dblitt 3y agoWhat extensions are you using for C# on code-server? AFAIK the official C# extensions from Microsoft (C# base and dev kit) aren’t licensed for non-vscode use.
- VikingCoder 3y agoWell, I think I'm doing the dumbest thing possible, which is just running code-server with not many extensions... I'm using code-server as a dumb text editor, akin to using notepad.exe back in the day. But I'm honestly very comfortable with that. Especially for the kind of code I'm writing.
- assimpleaspossi 3y agoAnd here I was just reading about how Microsoft is rewriting C# code in Rust: https://news.ycombinator.com/item?id=39240205 https://news.ycombinator.com/item?id=39240205
- athoscouto 3y agoFrom the job posting, the role is to work on M365. This means products like Exchange, SharePoint, and Skype. I'll go out on a limb here and say that this new team will work on replacing existing C++ (not C#) code with Rust.
- assimpleaspossi 3y agoThe article quotes the job posting: >The job, a principal software architect for Microsoft 365, has responsibilities that include "guiding technical direction, design and implementation of Rust component libraries, SDKs, and re-implementation of existing global scale C# based services to Rust."
- athoscouto 3y agoFrom the job posting (https://jobs.careers.microsoft.com/global/en/job/1633482/Principal-Software-Architect https://jobs.careers.microsoft.com/global/en/job/1633482/Pri...): > guiding technical direction, design and implementation of Rust component libraries, SDKs, and contributing to the building of global scale services in Rust. Maybe the article misquoted it. Maybe the posting was updated after the article. The only time C# shows up is on the required qualifications section.
- NoPedantsThanks 3y ago[dead]
- KacharKhan 3y agoIf a platform completely ignores Linux as the first-class target for its GUI library (MAUI) -- how can we trust it with anything else it does on Linux. We must never forget that MAUI is targeting Windows, MacOS, Android, and Ios --- but not Linux. It's not like you can't do Linux -- if humble FOSS projects like Avalonia and Uno can do it -- a tech giant can sure as hell do it. But no, they specifically not covered Linux in MAUI. Is cross platform client a big deal ? ... maybe , maybe not .. but that's not the issue. The issue is discrimination and the terrible terrible message it sends to the developer.
- tracker1 3y agoWhile I agree, one even commented as much on some of the Relevant GitHub issue threads... .Ner is a pretty good platform for web and backend work. I prefer Rust or even Node/TypeScript myself, but have worked a lot in the .Net space since pre release in 2002.
- smackeyacky 3y agoHaving worked on node and .NET on Linux professionally I vastly prefer .NET JavaScript and typescript exist in a bizarre netherworld of not really being type safe and not really being type free. It makes for some truly strange code bases that reflect whatever is cool but none of it aged well. Npm is hideous. Dreadful. It’s a daily struggle especially if you have to deal with private repos (azure specifically). C# is just a better language. Better, more expressive collections and a type system that has consistency. EntityFramework for databases is fantastic, node has nothing remotely as good. .NET and Nuget are a breeze. I would go as far as saying Linux is the superior experience when programming .NET since you spend a lot of time with the CLI and power shell sucks.
- dellamonica 3y agoWhat is wrong with PowerShell core? *PS core is the one based on the new versions of dotnet.
- 3y ago
- sam0x17 3y agoHell lets not forget trying to do this back in the Mono days when Microsoft specifically didn't want you to run .NET on anything but Windows.
- gregors 3y agoI suppose it's for the best, but I really miss the vibe and community around mono, running .Net on linux in 2008 was such a good time.