You are not logged in.

#1 2020-06-06 10:02:28

TheSheepGuy
Member
Registered: 2020-04-13
Posts: 16

The sad state of C# (and .NET Core) on Arch Linux

I'm a big fan of the language C#. Sure, I can develop in C++ or Python too, but I have a fondness for C#. Since Microsoft released .NET Core, the language is free and open-source and supports all three major operating systems (Win, Mac, and Linux).

Sadly, it's really difficult to develop C# on Arch. In order to write a simple console application, you have to install the .NET Core SDK, which is understandable as you need to do this for any language. Microsoft, as said in Arch Wiki, recommends you to use Visual Studio Code (VSCode for short) to develop C# (you need the MS branded release from the AUR to debug C#), which makes sense because it is the closest to a full IDE that you can get on Linux. In VSCode you need to install the Omnisharp extension too. Finally, you need MSBuild, Microsoft's compiler, to actually compile C#, more on this later on.

Ideally, this is all you need to do. In reality, if you have Mono installed too, you need to disable it in VSCode's settings, otherwise, everything is unrecognised and underlined by a squiggly red line. This is buried deep in a GitHub issue and would be helpful to have on the Arch Wiki. It seems like the Arch Wiki doesn't want to have a separate article for C# and instead just one for .NET Core, so this could be added under the troubleshooting section.

Next, you actually can't install the msbuild-stable package. You see, Omnisharp requires MSBuild >16.3, and the msbuild-stable package on the AUR is stuck on 16.0 since over half a year ago (August 2019). This means that you need to edit the PKGBUILD manually to download the 16.5 .deb package instead (I mean, you could use the 16.3 package, but why not use the latest stable version?). This should be fixed by orphaning the package and having someone adopt it soon since it's a critical package for developing C#, not a small and unknown language at all.

So to conclude, yes you can develop C# on Arch, but it took me at least two full days of trying to find out why things weren't working when it could have been prevented through more care at many different ends. I do want to edit the Arch Wiki, but you can't really write "The required package is out of date, so the PKGBUILD will need to be edited manually," I feel like once the msbuild-stable package is up-to-date, then the Wiki can be updated too.

Offline

#2 2020-06-06 13:29:31

Omar007
Member
Registered: 2015-04-09
Posts: 354

Re: The sad state of C# (and .NET Core) on Arch Linux

This seems like a complete non-issue honestly.

You can update the wiki no problem.
There is no reason why the troubleshooting step i.r.t. mono can't be put on the wiki page for .NET Core already, nor why you couldn't add a note mentioning that MSBuild should be 16.3 or higher. You don't really need to add more information than that because information on how to work with ABS, the AUR and PKGBUILDs is well written and available on the wiki already.

At the same time/after that you try to contact the maintainer of the AUR package. You can try with a comment or maybe try to contact the user with the contact info on the AUR profile or locate his forum account (if he has one) and send a message there. If there is no contact information available or you've not been able to get a response in a week or 2, just put in an orphan request and take over as maintainer.
Until then you could drop a patch in the comments of the current package to help people out in the mean time.

That said, afaik Omnisharp isn't a requirement for development though. Yes, it would be very handy and helpful but it's completely optional isn't it?
Which would make the second (both??) problem irrelevant at all for very minimal development. Though if stable is 16.5, the package should be updated so you might still want to take over and at that point you can remove the note again.

Last edited by Omar007 (2020-06-06 13:45:56)

Offline

#3 2020-06-06 17:50:14

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,827
Website

Re: The sad state of C# (and .NET Core) on Arch Linux

Moving to programming & scripting.

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#4 2020-06-06 21:19:21

TheSheepGuy
Member
Registered: 2020-04-13
Posts: 16

Re: The sad state of C# (and .NET Core) on Arch Linux

Omar007 wrote:

This seems like a complete non-issue honestly.

You can update the wiki no problem.
There is no reason why the troubleshooting step i.r.t. mono can't be put on the wiki page for .NET Core already, nor why you couldn't add a note mentioning that MSBuild should be 16.3 or higher. You don't really need to add more information than that because information on how to work with ABS, the AUR and PKGBUILDs is well written and available on the wiki already.

At the same time/after that you try to contact the maintainer of the AUR package. You can try with a comment or maybe try to contact the user with the contact info on the AUR profile or locate his forum account (if he has one) and send a message there. If there is no contact information available or you've not been able to get a response in a week or 2, just put in an orphan request and take over as maintainer.
Until then you could drop a patch in the comments of the current package to help people out in the mean time.

That said, afaik Omnisharp isn't a requirement for development though. Yes, it would be very handy and helpful but it's completely optional isn't it?
Which would make the second (both??) problem irrelevant at all for very minimal development. Though if stable is 16.5, the package should be updated so you might still want to take over and at that point you can remove the note again.

I had another look at it in more detail. You're right that Omnisharp isn't needed for development, but there's an even better reason why building C# isn't actually as bad as I thought.

I only just realised that the .NET Core SDK comes bundled with its own version of MSBuild (the current stable release .NET Core 3.1 uses 16.4) that gets used when "dotnet build" is run, that means that it's not actually needed for development, so that's absolutely my bad. That means that for developing C# you do just need the official package dotnet-sdk.

That said, .NET Core isn't the only way to develop C#. Mono can be used to compile the non-free .NET Framework (and I think .NET Core too? Though it makes more sense to just use the native tools for that). However, that package is also severly out of date, just under half a year (December 2019), and it's in the official repos, the extra one to be more specific. The IDE MonoDevelop uses Mono for many aspects including making desktop applications using GTK#, so the Mono package should be updated too. I'll see about emailing the maintainer of Mono tomorrow.

I was a bit hesitant on editing the wiki which is why I wanted to make this post first, but I'll make some changes to it tomorrow accordingly if that's a fine thing to do.

Offline

#5 2020-06-06 21:29:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,046
Website

Re: The sad state of C# (and .NET Core) on Arch Linux

TheSheepGuy wrote:

I was a bit hesitant on editing the wiki which is why I wanted to make this post first, but I'll make some changes to it tomorrow accordingly if that's a fine thing to do.

If you use the Talk page, you can canvass input before making substantive edits; it gives others an opportunity to contribute their thoughts, and improves the overall quality of the pages discussed.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2020-06-07 03:25:07

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,616

Re: The sad state of C# (and .NET Core) on Arch Linux

TheSheepGuy wrote:

That said, .NET Core isn't the only way to develop C#. Mono can be used to compile the non-free .NET Framework (and I think .NET Core too? Though it makes more sense to just use the native tools for that). However, that package is also severly out of date, just under half a year (December 2019), and it's in the official repos, the extra one to be more specific. The IDE MonoDevelop uses Mono for many aspects including making desktop applications using GTK#, so the Mono package should be updated too. I'll see about emailing the maintainer of Mono tomorrow.

Did you try bumping the version and seeing if it builds and the resulting package works well?

I have vague memories of the maintainer having a lot of trouble some time ago, trying to build newer versions of some parts of the .NET ecosystem, but I cannot find the relevant bug references at the moment. Of course I could be totally misremembering, or the problem had already been fixed by now.

Either way, if you're going to mail the maintainer, it's always great to receive a confirmation that one has tried the update and it worked for them (along with any relevant experiences or workarounds/patches needed), and it's a lot more actively helpful than just the benevolent interest inherent in "hey, I noticed this is out of date, is anything holding it up? I'd love to see an update soon".

Last edited by eschwartz (2020-06-07 03:25:58)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2020-06-07 08:11:59

TheSheepGuy
Member
Registered: 2020-04-13
Posts: 16

Re: The sad state of C# (and .NET Core) on Arch Linux

eschwartz wrote:

Did you try bumping the version and seeing if it builds and the resulting package works well?

Yeah, that worked well, at least for MSBuild. That package doesn't compile and just installs a .deb package, so you just need to change the version number which then changes the URL too. I'm not sure about the Mono package since I don't know about how packages in the repos work.

eschwartz wrote:

Either way, if you're going to mail the maintainer, it's always great to receive a confirmation that one has tried the update and it worked for them (along with any relevant experiences or workarounds/patches needed), and it's a lot more actively helpful than just the benevolent interest inherent in "hey, I noticed this is out of date, is anything holding it up? I'd love to see an update soon".

I'll email the MSBuild maintainer, but since I can't actually help with the Mono package I might wait a bit to see if someone more experienced could help with that.

Offline

Board footer

Powered by FluxBB