|
I am also having still problem, and this is critical for me: I have to manage creation and destruction of instances of class RDotNet many times because my code runs as a plugin and is launched by mainapp each time in different appdomain.
My env: Vista, x86, R-Community-5.0 (R 2.13.2), .NET 3.5/4.0
My code in windows forms simple app is like this:
private void button7_Click(object sender, EventArgs e)
{
string sRHome = FindRPath();
System.Environment.SetEnvironmentVariable("PATH", System.Environment.GetEnvironmentVariable("PATH") + ";" + sRHome);
REngine.SetDllDirectory(sRHome);
using (REngine engine = REngine.CreateInstance("RDotNet"))
{
NumericVector random = engine.EagerEvaluate("rnorm(5, 0, 1)").AsNumeric();
}
}
Works fine first time. Second time it hangs on the line with EagerEvaluate() call consuming CPU 100%. I have tried to check if bug persists: tested with R.NET 1.3 for .NET 3.5 and built latest source R.NET 1.4.1 for .NET 4.0. The problem persists.
I would like to ask author kos59125 to advise on this. Is there a way to fix this problem? Anyone has found some workarounds? Thank you.
|