Trouble Connecting on 64 Bit Machine

Jan 7, 2013 at 5:04 PM

Hello,

I recently transferred an application written in Visual Studio 2008 from a 32 to 64 bit machine. Everything worked perfectly on the 32 bit machine, but I am recieving the error "Object reference not set to an instance of an object" on the 64 bit machine. 

Here are the exact steps I took (on both on the 32 and 64 bit machine):

1.) I downloaded the dll "R.NET" (1.3 (framework 3.5))

2.) Added it to my project as a reference.

3.) Installed R 2.14.2 (I set the path to the i386 version on both)

4.) Verified that the .Net Framework was set to 3.5

5.) Verified that the target CPU was set to x86

The Code is pasted below.

Any suggestions? Thanks!

-----------------------

Imports System
Imports System.Linq
Imports RDotNet

Public Class Form1

    Dim Engine As REngine

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        REngine.SetDllDirectory("C:\Users\awm\Documents\R\R-2.14.2\bin\i386")
        Dim lsEngArgs(0) As String
        lsEngArgs(0) = "-q"
     
        Engine = REngine.CreateInstance("RDotNet", lsEngArgs)


    End Sub

    Protected Overrides Sub Finalize()
        Engine.Close()
        Engine.Dispose()
        Engine = Nothing
        MyBase.Finalize()
    End Sub

End Class

 

Jan 8, 2013 at 2:32 PM

For anyone who may encounter this problem in the future, I found the solution. When I originally installed R I did not install it as a local administrator. When I uninstalled and then reinstalled R (same version 2.14.2) as an administrator everything worked perfectly!