Hello,
I get an SEHException when I try to create an engine instance the second time. I'm using R 2.15.3 and R.Net 1.4.0.0.
I have implemented a wrapper that tests on startup if R is installed and if it works. The code for this is
```
using (REngine testInstance = REngine.CreateInstance("test"))
{
Version v = testInstance.DllVersion;
if ((v.Major == 2 && v.Minor >= 15) || v.Major >= 3)
{
_isAvailable = true;
}
}
```
Basically it is to ensure that a specific version of R is used. This happens in a static constructor of the wrapper class and works fine.
Later when really using an engine I create a new instance:
REngine.CreateInstance("Test2")
which throws the SEHException. The error code in the exception is 0x80004005. If I leave out the first engine creation above, the Test2 engine is created and works. I'm using net framework 4.0, VS2010, Win7 64Bit (but I use 32Bit R).
Stacktrace:
at RDotNet.Internals.DirectNativeMethods._setup_Rmainloop()
at RDotNet.Internals.DirectNativeMethods.setup_Rmainloop()
at RDotNet.REngine..ctor(String id, String[] args, CharacterDeviceAdapter adapter)
at RDotNet.REngine.CreateInstance(String id, String[] args, CharacterDeviceAdapter adapter)
at RDotNet.REngine.CreateInstance(String id, String[] args, ICharacterDevice device)
at RDotNet.REngine.CreateInstance(String id, String[] args)
at R2D2.RIntegrator..ctor(String instanceName) in D:\Projects\Consolidation\global\Prototypes\R-Integration\R2D2\RIntegrator.cs:line 91
It seems a known issue, not sure. Can this be solved or work around?
Thanks,
Christian
Comments: This is very likely a limitation of the native R engine.
I get an SEHException when I try to create an engine instance the second time. I'm using R 2.15.3 and R.Net 1.4.0.0.
I have implemented a wrapper that tests on startup if R is installed and if it works. The code for this is
```
using (REngine testInstance = REngine.CreateInstance("test"))
{
Version v = testInstance.DllVersion;
if ((v.Major == 2 && v.Minor >= 15) || v.Major >= 3)
{
_isAvailable = true;
}
}
```
Basically it is to ensure that a specific version of R is used. This happens in a static constructor of the wrapper class and works fine.
Later when really using an engine I create a new instance:
REngine.CreateInstance("Test2")
which throws the SEHException. The error code in the exception is 0x80004005. If I leave out the first engine creation above, the Test2 engine is created and works. I'm using net framework 4.0, VS2010, Win7 64Bit (but I use 32Bit R).
Stacktrace:
at RDotNet.Internals.DirectNativeMethods._setup_Rmainloop()
at RDotNet.Internals.DirectNativeMethods.setup_Rmainloop()
at RDotNet.REngine..ctor(String id, String[] args, CharacterDeviceAdapter adapter)
at RDotNet.REngine.CreateInstance(String id, String[] args, CharacterDeviceAdapter adapter)
at RDotNet.REngine.CreateInstance(String id, String[] args, ICharacterDevice device)
at RDotNet.REngine.CreateInstance(String id, String[] args)
at R2D2.RIntegrator..ctor(String instanceName) in D:\Projects\Consolidation\global\Prototypes\R-Integration\R2D2\RIntegrator.cs:line 91
It seems a known issue, not sure. Can this be solved or work around?
Thanks,
Christian
Comments: This is very likely a limitation of the native R engine.