Problems deploying ASP.NET application that uses R.Net

Dec 14, 2012 at 4:55 PM

Everyone,

I've built a simple interface in Visual Web Developer 2010 Express that accepts inputs, stores them in a database, then runs some code in R that pulls data from a database, runs a forecast algorithm and stores the result in the database.

Everything works fine testing from  Visual Web Developer on my laptop, but when I try to deploy the project to the server and view it in a browser I get a Dll Not Found error.  The code triggering this error is the code that instantiates the r engine.

I have tried copying the r.dll to several other places--to no avail.  I tried deploying the application to my own laptop also and ran into the same problem.  So I can run it from Visual Web Developer to but not from anywhere else.

Any ideas?

Thanks for the help!

 

            // Set the folder in which R.dll locates.
            var envPath = System.Environment.GetEnvironmentVariable("PATH");
            var rBinPath = @"C:\Program Files\R\R-2.15.1\bin\i386";
            System.Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + rBinPath);

            engine = REngine.GetInstanceFromID("RDotNet");
            if (engine == null)
            {
                engine = REngine.CreateInstance("RDotNet");
            }
            // Initializes settings.
            engine.Initialize();

Jan 3, 2013 at 7:24 AM

If your ASP.NET application is 64 bit, then you may check the following http://blogs.msdn.com/b/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx