One problem that comes up for us quite a bit when using R.NET from the RProvider is that we need to load it into multiple appdomains simultaneously. The native R.DLL is obviously AppDomain agnostic, but the R.NET instances are completely isolated.
The concrete problem is that in the second appdomain, the R.DLL fails during initialization because it is already initialized.
Any ideas on how we could make that work? Seems like R.DLL instances would have to be managed through some native code, or we would need some process-wide flag to record the fact that R.DLL has already been initialized.
Basically this is the same issue as the multiple-initialization problem.
Comments: Howard, Could you provide a small-ish example of how you run R.NET in multiple AppDomains? I looked at the request and sample code provided in the [related discussion](https://rdotnet.codeplex.com/discussions/538512). I can reproduce the issue, and I quickly got swamped by information clear as mud (at least to me) about the .NET security model. Beats me. I guess it shows code security is not the primary concern in scientific computing... Anyways. If you can provide a working example, I would get past this NotSupportedException showstopper and look at the issues I may have more of clue about.
The concrete problem is that in the second appdomain, the R.DLL fails during initialization because it is already initialized.
Any ideas on how we could make that work? Seems like R.DLL instances would have to be managed through some native code, or we would need some process-wide flag to record the fact that R.DLL has already been initialized.
Basically this is the same issue as the multiple-initialization problem.
Comments: Howard, Could you provide a small-ish example of how you run R.NET in multiple AppDomains? I looked at the request and sample code provided in the [related discussion](https://rdotnet.codeplex.com/discussions/538512). I can reproduce the issue, and I quickly got swamped by information clear as mud (at least to me) about the .NET security model. Beats me. I guess it shows code security is not the primary concern in scientific computing... Anyways. If you can provide a working example, I would get past this NotSupportedException showstopper and look at the issues I may have more of clue about.