For a while, I've been hoping to use R.NET.Community in a .NET Core app. Obviously though with the NuGet package not having been ported to .NET Core, that's been a non-starter. However, with the .NET Core 2.0 Preview 1 announcement that you can reference .NET Framework libraries from .NET Core, I gave this another go:
using RDotNet;
namespace RDotNetCore2
{
class Program
{
static void Main(string[] args)
{
REngine.SetEnvironmentVariables();
var engine = REngine.GetInstance();
}
}
}
Creating this as a .NET Core 2.0 app in the new Visual Studio 2017 Preview, this at least gets as far as compiling and running, but errors at the GetInstance
call:
Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Is there anything I can do to fix this, or this just one of those bits which isn't supported in .NET Core (which I suspect may be likely due to the fact that CAS isn't supported on .NET Core)?