2

I am currently using Manjaro Linux 20.2, with official JetBrains Rider from JetBrains Toolbox

I have installed this package package screenshot

When I'm writing in my terminal "mono" it runs. File location also looks fine.

When I'm opening my Environment tab in Rider. I got this. Environment Tab

I can create and run/execute/debug any projects with my .NET CORE

But I can't use the framework at all. A simple application like this New Project Window

And here... the error

In my settings -> build and execution -> I have these parameters path settings

I don't know what to do and how to fix this error. Tried many times disinstall/reinstall the Mono Package. But it's always the same. Maybe I should change somehow a Mono path here in Rider Settings ? But I don't know to where.. there are so many of these files in usr/lib and usr/bin

Please help me, I don't know what to do next and how to fix this.. I just know for sure. That it is possible to run Mono on UNIX. Something is wrong..

UPD1: I've discovered, that to run Mono on Linux. I should install a different package "monodevelop"

But according to GitHub, this package is not build-able on Linux anymore (only on MacOS) In fact..

I've discovered this "dotdevelop" package.. https://github.com/dotdevelop/dotdevelop But I don't know, it's looks like it doesn't work for me either. Or maybe I'm just putting a wrong file to my mono path settings in Rider..

UPD2: Maybe there is still hope for me, if I'll use .NET FRAMEWORK from inside a container ? https://hub.docker.com/_/microsoft-dotnet-framework

I know how to use Docker. It will be possible to use it in my Rider ? I don't get it.

Savonarolla
  • 459
  • 1
  • 5
  • 10
  • Probably your mono just does not have reference assemblies for net48? Try to change target framework for net472 or even net45 – xtmq Dec 15 '20 at 19:12
  • Is it possible to set mono msbuild in `Use MsBuild version` (your screenshot `path settings`)? – Ivan Shakhov Dec 16 '20 at 10:21
  • updated the original post @IvanShakhov what do you mean ? – Savonarolla Dec 16 '20 at 16:16
  • echo $PATH /home/ray/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin – Savonarolla Dec 16 '20 at 16:18
  • The .NET Framework Docker image is based on a Windows image, so you can only run that on Windows Docker. Again, everything about .NET Framework is on Windows. Possible to run on Mono doesn't mean you should go that way (waste of time and gain little). – Lex Li Dec 16 '20 at 17:11
  • Try this package then https://discover.manjaro.org/packages/mono-msbuild – Ivan Shakhov Dec 17 '20 at 17:12
  • @IvanShakhov On their official GitHub https://github.com/mono/linux-packaging-msbuild It's written that .Net Framework is also not available on Linux.. – Savonarolla Dec 23 '20 at 20:40
  • I can only say, that on my Ubuntu machine I have installed mono-complete package, which includes mono msbuild, then I selected that mono msbuild in Rider preferences as a Build Tool and it lets me work with Full Framework projects, except windows specific part like WindowsForms/WPF. – Ivan Shakhov Dec 24 '20 at 10:03

2 Answers2

2

This answer essentially has what you're looking for. There is an issue in recent mono packages for some distributions that causes Rider not to have a proper reference to the mono libraries.

JetBrains Rider not detecting mono or Unity API

I've tried this on Debian 11 and it works as expected. I also use an Ubuntu machine and I didn't have to do this. I'm not entirely sure why, all I know is that some distros need the override set in in order to work. I use KDE Plasma and used their method of setting environment variables. There's a million ways to do that, check Majaro's documentation for what's best for your system.

**Before reading below, be aware that we're talking about legacy software and there's no guaranty that Mono will work in the future since it has been superseded by .NET (core). New development should be done there rather than Mono/.NET Framework unless you really need to. Just be aware it's legacy at this point and ymmv.

As for the other comment that there is no .NET Framework on Linux, that's not completely true. Mono is the .NET Framework implementation for Linux and macOS. It supports a large portion of the .NET Framework that exists in the Windows version, however it has some drawbacks.

For instance, WinForms is only partially supported and extremely buggy. WPF will not work at all.

ASP.NET can be run under Apache with a plugin, however it doesn't support all of the frameworks that you can use on Windows. For modern .NET web development on non Windows platforms, .NET 5+ should be used.

Another weird one is that the Console.Beep() method works unreliably. The Console.Beep(int frequency, int duration) method also doesn't work on macOS at all.

Other than those examples, there's other things that won't work which are mainly things that rely directly on the Windows API though it's possible to run .NET in some capacity under WINE. This isn't recommended though. Anything that uses COM will not work as well. It's also practically impossible to use a printer so that's probably out.

You can review https://www.mono-project.com/docs/about-mono/compatibility/ for a better list of what is and isn't supported.

For console applications, mono works quite well. Just be aware that not everything will work.

Good luck!

trademarq
  • 90
  • 8
  • 1
    I hope the optimism around Mono can calm down. While you commented like "it supports a large portion of the .NET Framework", "mono works quite well", and "ASP.NET can be run" and even WINE, you should be aware of the facts that Microsoft stopped most investment on Mono a long while ago (ever since the acquisition of Xamarin) as .NET Core quickly takes over most of the responsibilities. Mono is doomed to go away https://halfblood.pro/the-end-of-mono/ so don't mislead anyone there any more. – Lex Li Nov 16 '22 at 05:48
  • @LexLi I don't mean to be optimistic, it just answers the question and gives a little information about what is and isn't supported. All I'm trying to point out with that is that it's not true that .NET Framework doesn't exist outside of Windows. It does and works well for what it is. Eventually, both Mono and .NET Framework will go away since they're both legacy at this point. .NET should be used for sure if you're working on something new and the legacy stuff should only be used if you need it to support other legacy software. I'll edit the post to reflect that. – trademarq Jan 02 '23 at 06:18
  • .NET Framework will be long live and supported by Microsoft just like its ancestors (VB 6 and classic ASP). Work on Mono has been concluded in 2020-2021 (by https://github.com/mono/mono/graphs/contributors), so Mono is on a different track, not really covered by Microsoft support policies or contracts. Anyway, many on Stack Overflow simply don't care about commercial support at all, so answers like this can ultimately lead people to dead end. – Lex Li Jan 02 '23 at 06:27
-1

You should create a console application by choosing "Console Application" under ".NET Core".

I wonder why Rider guys decided to show the projects under ".NET" to mess things up. Beginners like you won't be easy to know what they are and how to run them on non-Windows machines.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • 1
    As I've said before. I have no problems with .NET CORE I just want to practice with .NET FRAMEWORK – Savonarolla Dec 16 '20 at 16:02
  • @Savonarolla There is no .NET Framework on Linux, so use Windows to really practice that. – Lex Li Dec 16 '20 at 17:10
  • You can run and debug .net FRAMEWORK on linux. It is provided by MONO. Look at mono compatibility. You can even run WinForms apps on linux – MajesticRa Nov 16 '22 at 05:25
  • @MajesticRa If you ever observed the Mono project for long enough, you shouldn't have been that optimal, https://halfblood.pro/the-end-of-mono/ – Lex Li Nov 16 '22 at 05:42
  • Yep, there is a grim tendency for mono. But it works. And in real life, e.g. we support 10 years old WinForms application which works on mono and will support it for at least the next couple of years. So the statement: "no .NET Framework on Linux" is false. And you can use mono for at least a couple of more years if you need. And sometimes you need it. – MajesticRa Nov 17 '22 at 22:44
  • @MajesticRa WinForms Mono works especially bad on localization/varied DPI and other scenario. So, you are just lucky enough or tolerable enough, while others like me never assume it is a feasible way to ship applications. What exactly is false? Mono isn't .NET Framework, as .NET Framework is strictly a Microsoft product for Windows. Mono never claims itself to be .NET Framework (and it cannot as well as the brand is owned by Microsoft). **You can** definitely use legacy things, but I was saying **nobody should**. – Lex Li Nov 18 '22 at 02:52
  • You said "Mono works..." - yep, with all "but..." it works. People ask technical questions here, and await to get technical answers. But you try to tell them what to do. Moreover, you do that not only based on technical facts but on your assumptions about future and your tastes. – MajesticRa Nov 21 '22 at 03:55
  • @MajesticRa I used Mono WinForms heavily for as long as it could support, and I commented based on the facts that bugs are never fixed and the repo is almost abandoned (take a look at https://github.com/mono/mono/graphs/contributors with your own eyes). You can definitely say it works for you today as that's the fact you stick to, but the world is moving fast enough to render you wrong soon. – Lex Li Nov 21 '22 at 06:23
  • I used Mono WinForms and still use them. And I met some bugs that I have to fix myself (you can look through my history here to find at least 2 of those). And I agree that the future is gri... Oh... I remembered those bugs... And how I wrote on forums about them... And how it was easier to fix myself. Ok. Heck with it. People listen! Use SDK7 and Avalonia if GUI is needed. (SO don't let me change my down-vote, sorry, I tried to change it after your first reply here). – MajesticRa Nov 22 '22 at 03:22