108 comments

[ 3.4 ms ] story [ 189 ms ] thread
Not 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.

Unity 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.

Have you had trouble debugging unity with VS in the past? I can't recall ever having any issues personally.
> 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#.

Our 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
To 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.

They'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/CSharpC...

Funny 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
Unity 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).

Can one .NET GUI application look and feel native on Windows and Linux?
Depends on what GUI library you're using, same as every other programming environment. There's GTK Sharp for C#.
Yes, 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/

That'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.
I 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.

Most 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.
How does what you're talking about suggest the parent comment is "rich?"
I'm saying Microsoft's actions are rich, not his comment.
Relying on Microsoft for UI is like relying on the Smithsonian to DJ your party.

They do a great job. Just...not at that.

I'm not sure I consider any apps on either to look native at this point.

I'd rather just have a, Material or Fluent UI in either , the latter being current windows design style.

They've both changed so much over time along with a mix of applications applying different design styles all around.

It 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).

> 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.

You 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).
My 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.
> 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.

I’d advise using Jet brains Rider for serious C# development (on both Linux and Windows). It’s a serious competitor to Visual Studio (and is vastly superior to VS Code)

Yup! Well worth the 20 bucks a month!
Why is that? I've used JetBrains IDEs in the past, but haven't found anything that compelled me to spend money on them (and lock myself to a proprietary editor, which is a bigger issue for me).
I work on a big monorepo. OmniSharp takes so long to load that it's basically useless, I gave up at 10min. Rider takes a minute or so.
With the new Dev Kit extension in VS Code, it no longer uses omnisharp. So it may gotten better in larger monorepos.

But my guess it's still faster in Rider

Dev Kit extension is also partially pay for play, as only a subset of its features are available under community license.

"C# Dev Kit builds on the same foundations as Visual Studio for some of its functionality, it uses the same license model as Visual Studio. This means it's free for individuals, as well as academia and open-source development, the same terms that apply to Visual Studio Community. For organizations, the C# Dev Kit is included with Visual Studio Professional and Enterprise subscriptions, as well as GitHub Codespaces."

It is, the irony of Microsoft not being willing to do the same as Java folks have available in IDE options, as in free beer, and commercial alternatives.

Instead it is either Electron or Java/Kotlin, in both cases commercial licences (new VSCode plugin has different licence levels).

Blazor is such a disaster. Frameworks like Next/Remix/Svelte are running circles around it. I'd go so far as to say they should create their own TypeScript based SSR framework if they still want to be relevant in the non-enterprise web game.
I think that Razor + HTMX might be the better approach in that space.
I find the HTML fragments needed to be HTMX to be unmaintainable for large projects. The static typing for the fragments isn't there either when you're trying to compose fragment components.
> if they still want to be relevant in the non-enterprise web game

They don’t. Microsoft makes products for companies who will pay for software.

They're losing a lot of business to Next.js/Remix/Svelte. If MS had a viable competitor based on .Net then more businesses might keep their IIS and Windows Server licenses. The Windows path leads businesses to SQL Server as well. I've seen this play out first hand.
Sadly can confirm, I have been working as polyglot dev for years, also a reason why I have so many opinions, never siloing under a specific XVYZ Developer label.

Several CMS on the .NET ecosystem that relied on .NET for their plugins, when they went headless, decided to focus on supporting Next.js and friends for their UI component layer, removing Web Forms, MVC, Razor Pages support for these kind of workflows.

Others, like Sitecore, decided that it was too much code to rewrite from .NET Framework to .NET Core, and not only refocused on Next.js with Vercel agreements, they also pivoted for an API first approach, and acquired non-.NET based products as means to evolve their product roadmap away from .NET.

Myself, I have been involved in a couple of .NET Framework to Java migration projects, as given some of the stuff the customers would need to write from scratch in modern .NET, they decided it was the right time to move away from Microsoft stack on the server infrastructure.

It should be noted that it isn't an accident that Microsoft, after all these years, has acquired jClarity and is now an OpenJDK contributor.

Who have thought to see this kind of stuff a few years ago?

https://devblogs.microsoft.com/java/

https://www.theregister.com/2024/01/31/microsoft_seeks_rust_...

Microsoft fucked themselves hard having basically no upgrade path from legacy ASP.Net Framework to what there is now.

It basically dead ended the large million line app that ran the company I worked for and forced a costly rewrite away from Microsoft. Though many parts of it still exist today, still on 4.8.

For a company, Microsoft, that prizes backward compatibility and typically provides good upgrade paths, I felt very betrayed having trusted them as our platform.

The upgrade path to ASP.NET Core itself is the most straightforward out of everything that existed during .NET Framework days, a lot of code requires little to no changes and the code that requires a lot usually was questionably written in the first place or relies on problematic APIs.
What are you talking about? ASP .Net Framework versus Core is completely different. Not just rewritten the API is totally changed as well. Many libraries were completely removed - WebForms, OData 3, the entire bundling infrastructure, etc.. How requests are handled, and how you pre/post process requests is completely changed as well.

Their documentation even says, "Updating an app from ASP.NET Framework to ASP.NET Core is non-trivial for the majority of production apps" Even that is an understatement. https://learn.microsoft.com/en-us/aspnet/core/migration/inc/...

It was not trivial but the subjective experience matters a lot. In migrations that I participated in the most difficult parts were not related to ASP.NET but to third-party libraries. Another pain point at the time was moving off WCF which ended up being packaged up on some legacy Windows host as a separate microservice for just that purpose to not hold everything else back but that's it.

Swapping out the startup and hosting models was not a challenge because the APIs were comparable, some controller classes had no lines changed either, and moving off IIS pool arguably is all around improvement (and far easier, to manage with docker and deployment manifests).

I don't know what disaster you're talking about. Blazor server is a complete .NET vision of "html over the wire" - it has some major downsides and is only appropriate in particular scenarios, but in those scenarios it shines. Effortless "push to the frontend", and not having to write an API for your frontend, those things are worth a lot.
(comment deleted)
They are only great for those of us that use Windows as our main desktop.

Microsoft's scenario for non-Windows is clearly driven by Azure and mobile platforms.

VSCode development experience is only done to be good enough to drive people into VS proper, as it has already been confirmed in a couple of podcast interviews, that there is no plan for feature parity.

So if one wants feature parity with VS outside Windows shelling out money for Rider is the only option.

Ironically Java still wins out in tooling, not only is InteliJ community free beer, there is Eclipse and Netbeans, while Red-Hat in collaboration with Microsoft, makes most of headless Eclipse run on VSCode, a much better experience than .NET on VSCode.

Even the Python experience on VSCode is better.

Additionally none of them have "pro" features gated by license, as in the .NET VSCode plugin.

It feels like while .NET team tries to turn the ecosystem around into FOSS, management ie still pretty much into VS/Windows/Azure, with some carrots for other scenarios.

> 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.

I'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?
They 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.
yeah no docker for us.
This is an interesting take considering Microsoft's entire ecosystem feels like "we have open source at home"
I 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.

I 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.
.net development on VSCode is not a good story. C# Devkit may change it but Omnisharp was not such a successful story.
Absolutely, 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)
What is the latest story of native UI's with .NET. There is always some half baked stuff going on and abandoned all the time.
The latest is MAUI, which seems to take a Dart/Flutter like approach.
As 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.
Does this take anything away from the rest of .NET?

Serious question.

Not expressly, I just wouldn't invest in it, since it will likely fall into a dead end, like Silverlight.
I'm not sure you answered my question.

Just don't use MAUI, in favor of anything else?

Why 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 : )

It's worth to note that MAUI is not cross-platform (Microsoft say it is, but for me excluding Linux desktop and calling it cross-pratform is a lie/marketing bullshit)
That's not true. They support Android, iOS, and MacOS. I agree it's disappointing that they don't support Linux, but it is by definition cross-platform.
MAUI sucks big on desktop UI. Try Avalonia and it is 100 miles ahead of the game!
I see that Avalonia has a XAML previewer in VSCode. That's a big selling point for me so I'll give this a try. Thanks for mentioning it!
With all its quirks, flutter is still miles ahead of MAUI (just look at actual usage of maui, it's close to 0). And imo they both take a pretty different approach anyways.
MAUI uses native controls, wrapped in its own system. Considering that Flutter draws everything itself I'd say that's a pretty substantial difference. It also manifests in how close to native your app can look/feel or how easy it is to integrate features of the respective native controls.

Avalonia is perhaps closer to Flutter.

I haven't used it myself but I've had some colleagues recommend avalonia to me. They seem to really like it over MAUI.

Honestly I still love WPF (perhaps it's Stockholm syndrome). Obviously WPF only runs on windows desktop though.

Check out Avalonia’s XPF. Allows WPF to run on macOS and Linux with almost no changes in most cases.

https://avaloniaui.net/XPF

Thank you! I had no idea something like this existed!
Seconded.. IIRC, I Believe even since cross platform tools from Microsoft (Git Credential Manager) use it.
Same. Avalonia and Uno are the go to options for cross-platform UI on .NET these days.
I 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.

To 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...

Well 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.

Alongside 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.

I 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.
The 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.

Don't forget that there have been native Linux builds of Microsoft SQL server for a long time - along with (Linux) docker images.
I 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.

Upgrade to the 17 dollar a year racknerd vps for additional happiness
What 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.
Well, 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.

And here I was just reading about how Microsoft is rewriting C# code in Rust: https://news.ycombinator.com/item?id=39240205
From 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.
The 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."

From the job posting (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.

If 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.
While 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.

Having 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.

What is wrong with PowerShell core?

*PS core is the one based on the new versions of dotnet.

You can build a web server and do ETL with PowerShell?

If it's a simple script, bash is in the box... If it's more complex, I'll reach for a more rich scripting platform.

I mean, the entire dotnet is available, you can do anything in PS though obviously that is not always the smart call.

It has been very useful to me to use as a REPL on my own C# libraries, I can instantiate and use types from these libraries and interface with the file system and network on an ad hoc basis.

I am old - my first work experience was on Unix machines in the late eighties and I just find Linux a lot easier to work with if you're spending a lot of time with a CLI. You have more default tools at your disposal (bash, make, sed/awk/grep etc) which all have to be installed manually on a Windows machine.

Powershell tries to be everything and ends up being too much, badly implemented. I have dabbled in it for Windows/Microsoft specific things (Outlook manipulation) but while you can write a PS script that tries to do something like delete all yesterdays mail with a particular characteristic, in practice it often doesn't work due to the impedence mismatch between COM and PS. I like the idea, I really do, but it's just not as straight up practical as the Unix tools.

Yes, if you don't use dotnet and is already used to Unix tooling then it is a tough sell, but otherwise the integration with dotnet is quite good.
I like the Deno runtime approach more than Node, but that's another issue. I find JS/TS is pretty great for ETL and input data validation and transformation where the flexibility of the language and io streams lend themselves to that work. Not to mention when you need a slightly different script.

I also like the expressiveness and productivity I get out of it. Though many of my issues with C# comes down to the culture in practice more than the language.

C# is better when you have more firm constraints and the coffee will be longer lived and worth the complexity. It's just the difference between a script and a full program/application with all that involved in the Net space.

My point was mostly that. Net is still pretty good for things in Linux even without a blessed, official desktop UI framework.

That is the problem nowadays, it feels like ASP.NET/Azure is driving .NET roadmap.
Interesting logic.

What about Java or Go? You could say they do ignore Linux as well...on the grounds of not having nice to use first-party crossplat GUI framework that can target Linux. Where are the OracleUI or GoogleGoUI?

Well Java has Swing that, iirc, works on all platforms OpenJDK runs on and Go doesn't have a sanctioned GUI in it's stdlib.
Exactly! Somehow no one puts this against Go or a myriad of other languages where you are expected to use bindings to Qt or Gtk and yet for C# it's suddenly "akchually no support for Linux in MAUI, therefore it is second-class citizen". There are Avalonia, Uno and many other small-ish frameworks which support Linux, there are Qt and Gtk bindings, or you could go the MonoGame, Unity or Godot route instead.

Beats me how this kind of thinking works, always excuses instead of evaluating the technology on its merits and the experience it offers. Sometimes I feel like it's the community that actually hinders the transition towards more decentralized FOSS-style ecosystem (on this website it is more likely to be simply bad faith arguments).

p.s.: I'm daily driving Ghidra currently which is built with Java Swing and it looks like straight out of 90s in a bad way haha

I _think_ those line of responses mainly come from the belief that because .NET versions since Core 1.0 has gone cross-platform that there is some expectation that the first-party GUI solutions would apply on platforms that have official ports of the runtime; and that since Microsoft is a behemoth then surely they could do it.

On a tangent and I also don't know how others would view this, but I personally think that trivial desktop applications have or will have moved on to solutions like (but not exactly server-sided) Phoenix Liveview or Blazor Server. No real need to bother with multi-platform solutions when there's already one the end user uses daily and is battle tested. The case of applications needing the usage of a GPU likes games aside that is.

> p.s.: I'm daily driving Ghidra currently which is built with Java Swing and it looks like straight out of 90s in a bad way haha

I don't know, I have a fondness of that old ass style of GUI lol

AWT and Swing were there since the early days, and despite all its warts, it was Oracle that made JavaFX usable, a scripting toy in Sun days before the company went down, torpedoed by Google, which wasn't even there for the acquisition party.

JetBrains IDEs and Netbeans are powered by Swing.

The sheer fact that this is still a top comment illustrates the overarching issue with the community and complete lack of understanding how OSS ecosystems work (or the amount of "people" who would like to see .NET fail).
I remember a thread on HN when Mono was first a thing. It was highly negative. Despite something like Mono being exactly what Linux desktop's needed. A way to easily slap together GUI apps.
Hell 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.
I 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.