MikhailArkhipov / vscode-r

R Tools for VS Code
Other
82 stars 6 forks source link

Using alternative path for dotnet #86

Open Stfort52 opened 2 years ago

Stfort52 commented 2 years ago

Hello, I'm having some problem regarding starting R Host for this extension. The extension worked like a charm when I was running it on my private ubuntu server. Now I have to work on a remote server where I do not have the administrative rights. In other words, I can't just install dotnet-sdk via apt-get. Therefore, I was trying to use a local installation of dotnet-sdk such as the Anaconda installation. However it was not successful as the microsoft Would you mind giving some advises regarding this issue?


General informations

$ which dotnet
CENSORED/stfort/.mambaforge/lib/dotnet/dotnet

Possibly related code

private ProcessStartInfo GetProcessStartInfo(string rhostBrokerExecutable, string pipeName) {
    var baseArguments =
        $" --logging:logFolder \"{Log.Folder.TrimTrailingSlash()}\"" +
        $" --logging:logHostOutput {Log.LogVerbosity >= LogVerbosity.Normal}" +
        $" --logging:logPackets {Log.LogVerbosity == LogVerbosity.Traffic}" +
        $" --urls http://127.0.0.1:0" + // :0 means first available ephemeral port
        $" --startup:name \"{Name}\"" +
        $" --startup:writeServerUrlsToPipe {pipeName}" +
        $" --lifetime:parentProcessId {Process.GetCurrentProcess().Id}" +
        $" --security:secret \"{_credentials.Password}\"" +
        $" --R:interpreters:{InterpreterId}:name \"{Name}\"" +
        $" --R:interpreters:{InterpreterId}:basePath \"{_rHome.TrimTrailingSlash()}\"";

    var psi = new ProcessStartInfo {
        FileName = "dotnet",
        UseShellExecute = false,
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        Arguments = $"{rhostBrokerExecutable} {baseArguments}",
        CreateNoWindow = true
    };
Stfort52 commented 2 years ago

Here is the dotnet version, just in case.

$ mamba list | grep dotnet-sdk 
dotnet-sdk                5.0.408              h751d214_0    conda-forge
$ dotnet --version
5.0.408