Using Rider under Linux: prerequisites

Development in JetBrains Rider under Linux will require at least one of the following additional frameworks depending on the kind of developed application:

17 comments

hi,

dnx is already deprecated & replaced with .net cli - so should rider work with .net cli too?

0

I'm running Ubuntu 16.04 with latest Mono (4.2.1) and .NET Core 1.1. When I try to open up a basic hello world project, I get the following:

 

Project 'helloworld' load failed
The lifetime has already been terminated.
Object name: 'Lifetime'.

Project 'helloworld' load failed: Can't connect to MsBuild project model process in 600000 ms

 

Any ideas on what the issue/solution could be?

4

@Brandon, You may try to update mono to 4.8 or 5.0, if it will not help, then zip and submit somewhere all logs from Help->Show log in Files folder. Follow up here.

Edited by Ivan Shakhov
0

Hi, I'm using Ubuntu 16.04 and I've installed Mono (5.2) and .NET (2.0). I created the sample shown here http://www.mono-project.com/docs/getting-started/mono-basics/#winforms-hello-world to verify that Mono is working.

I can run the application from the command line as the instructions say. But when I open the file in Rider 'Forms' in 'using System.Windows.Forms;' is red (and everything depending on it). Obviously I can not run the program from Rider and get the error: Program.cs(2, 22): [CS0234] The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?).

What do I have to do to make Rider pick up the red parts? 

0

I have Ubuntu 18 running in a VirtualBox. Installed dot net core as shown under prerequisites link. Logged in to Ubuntu as root. When I run the ./rider.sh, It returns "Killed". I don't see that message in the .sh file... Linux newb. Any ideas?

 

EDIT: Problem was allocated memory in VirtualBox. Bumped to 6Gb and all is good.

Edited by Matthew Carr
0

On Linux Rider does not detect dot net core even though it is installed. Mono is detected. How does Rider find the dot net installation? The CLI tools are on my path and work just fine from the command line. I have looked and looked but I can't find any information or configuration settings that I can configure to make this work.

Thanks

1

@Richard, does it work if you manually set dotnet path in Rider settings?


0

@Ivan

Thanks for pointing that out. I was able to get things working with that information. It should be noted that Rider seems to be making some assumptions about the path where the dotnet executable is found at. In my case the executable in the /usr/bin directory is actually a shell script that sets up the environment before calling the real dotnet executable /opt/dotnet/dotnet . You have to point the configuration at the real dotnet executable or Rider will not find the SDK or runtime. I would think this would be more portable if Rider just ran "dotnet --list-sdks" to find the install SDKs and "dotnet --list-runtimes" verses making assumptions about how dot net is installed on the host systems. This is especially true of Linux distros which may move things around or like in my case use a wrapper script that makes things easy from the command line but not so easy for Rider to make assumptions about file system layout.

Again thanks I have things working now.

 

1

@Richard

We try to find dotnet in path and use it as a first choice. Why did you made such a thing with an executable in the /usr/bin directory? Is there recommendations to do things this way? Could you share with us? How common is this approach? It may also help, if you share the whole wrapper script (somewhere in gist). Thanks!

-1

It is standard on all the linux distros ive used dotnet core on to have a shell script at /usr/bin/dotnet which then runs the actual executable /opt/dotnet/dotnet

 

/opt/dotnet is not on the path

Edited by Leecannon Siy
1

I am having the same issue as @Leecannon.

Here is an example of /usr/bin/dotnet:

```

$ cat /usr/bin/dotnet
#!/bin/sh

export DOTNET_ROOT=/opt/dotnet
exec /opt/dotnet/dotnet "$@"

$ cat /usr/bin/msbuild
#!/bin/sh
MONO_GC_PARAMS="nursery-size=64m,$MONO_GC_PARAMS" exec /usr/bin/mono $MONO_OPTIONS /usr/lib/mono/msbuild/15.0/bin/MSBuild.dll "$@"

```

OS: ArchLinux

Edited by Patrick
0

@Patrick

I'm on Arch as well and if you scroll up a few comments you will find the clues you need to fix this but the steps are:

  1. In Settings -> Build, Execution, Deployment -> Toolset and Build -- Set .NET Core CLI executable path: Custom then /opt/dotnet/dotnet

Another issue you will have relates to msbuild the mono version of msbuild does not work in all cases with dotnet core. I don't remember off the top of my head where those failures are but to fix it you need to use the dotnet core version of msbuild which was included when you installed dotnet core. You can leave mono msbuild installed if you want just know that if you do you will have to call each explicitly depending on what you are building. I personally have a script file in ~/bin/msbuild which contains:

#!/bin/sh

exec /usr/bin/dotnet msbuild "$@"

where /usr/bin/dotnet is the script that sets things up for dotnet core and executes /opt/dotnet/dotnet

Then I have ~/bin first in my path so the msbuild that I have defined is found first. After doing that things have worked as expected in Rider.

Oh on the command line after you have that script defined and in your path correctly when you run it the out put will be :

Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Don't forget depending on how you are launching Rider you may need to logout/login so that your new path will be seen. Or if you are launching rider from a script you could just change/alter the path for rider then restart it.

 

 

1

@Richard thanks for your feedback!

As reference, here are the settings that seem to work with C# and F# on linux:

 

Edited by Patrick
0

The previous mentioned workaround doesn't seem to apply to the newest .NET SDK anymore.

I now have the error:

The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. at (137:5)

Arch Linux updated dotnet a few days ago. Current versions are:

$ dotnet --info 
.NET Core SDK (reflecting any global.json):
Version: 2.2.105
Commit: 7cecb35b92

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /opt/dotnet/sdk/2.2.105/

Host (useful for support):
Version: 2.2.3
Commit: 6b8ad509b6

.NET Core SDKs installed:
2.2.105 [/opt/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.3 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

 

Any pointers?

Here are the relevant changes:

[2019-03-18 07:49] [ALPM] upgraded dotnet-host (2.2.1+102-1 -> 2.2.3+105-1)
[2019-03-18 07:49] [ALPM] upgraded dotnet-runtime (2.2.1+102-1 -> 2.2.3+105-1)
[2019-03-18 07:49] [ALPM] upgraded dotnet-sdk (2.2.1+102-1 -> 2.2.3+105-1)

Edited by Patrick
0

@Ivan

If installing the .NET Core SDK using Microsoft's official Snap package on Ubuntu or other supporting Linux distros, Rider fails to auto detect the installation. By default, due to the way Snaps work, the command for dotnet is dotnet-sdk.dotnet, though this can be aliased to the usual plain dotnet with sudo snap alias dotnet-sdk.dotnet dotnet. 

Anyway, the dotnet CLI is installed in the following directory: /snap/dotnet-sdk/current/ and once this is set MSBuild is also auto-detected

0

@Paul, I have added a request for snap dotnet cli autodetect https://youtrack.jetbrains.com/issue/RIDER-27491

1

Please sign in to leave a comment.

Have more questions?

Submit a request