C#使用R.net(RDotNet)混合编程,配置环境时发生错误“This 32-bit process failed to load the library R.dll. Native error message is '句柄无效。'””

System.ArgumentException:“This 32-bit process failed to load the library R.dll. Native error message is '句柄无效。'”

因为电脑为64位,因此安装的R也是64位的

上述错误貌似是因为应用程序为32位,无法使用64位R.dll导致的

尝试改变应用程序设置

项目属性中修改解决方案平台为64位,问题解决

总结:解决方案的平台设置为any cpu 时,系统会默认选择32位,因此在使用64位的dll时需要特殊处理

原文地址:https://www.cnblogs.com/qianheng/p/11214677.html