2

I just recently discovered R.net

Using visual studio express I wrote a small hello world in C# and it runs perfectly.

When I publish it the program works on my computer. However, it does not work on anyone elses.

I suspect the problem is that other users do not have R installed. Here is what i consider the suspect line of code:

var rBinPath = @"C:\Program Files\R\R-3.0.2\bin\i386";

I suspect that I must publish the .exe with the R.dll but to be honest I am not sure how to do this as I am fairly new to visual studio.

Has anyone ever succesfully made a standalone executable using R.net? How did you solve this issue?

Any help is appreciated.

cheers!

1 Answer 1

2

If the deployment machine does not have R 3.0.2 at this exact location indeed this is the probable issue. If you use R.NET 1.5.5, your application has to discover the right path to R.dll. There are examples on how to do that in the documentation page.

The latest dev code (currently on a branch), which should lead to a new release within weeks, uses path discovery using the Windows registry by default, and will just work as is on most Windows boxes. To some extent also on Linux/MacOS, but these are trickier, and require some environment variable settings before application start.

If you need full control on path specifications, you can also use an app.config file.

Sign up to request clarification or add additional context in comments.

2 Comments

I originally intended to run this .exe on a machine regardless of R being installed or not. I realise now that this may not be "legal"
Even with R.NET 1.6, under some scenarios, it is necessary to append to the Windows Environment System Path variable, the path to R dlls: C:\Program Files\R\R-3.1.0\bin\i386

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.