Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9082205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:30:14+00:00 2026-06-16T20:30:14+00:00

I am using R.NET dll found here: http://rdotnet.codeplex.com/ I am trying to run the

  • 0

I am using R.NET dll found here:
http://rdotnet.codeplex.com/
I am trying to run the sample code from within a custom C# DLL specified for Tradelink (http://code.google.com/p/tradelink)
Here is the code.

   using System;
   using System.IO;
   using System.Linq;
   using RDotNet;
   using TradeLink.Common;
   using TradeLink.API;
   using Microsoft.Win32;

namespace Responses
{
    class RTLTest : ResponseTemplate
    {


        ////static void Main(string[] args)
        public override void GotTick(TradeLink.API.Tick k)
        {
             //Set the folder in which R.dll locates.
            REngine.SetDllDirectory(@"C:\Program Files\R\R-2.12.0\bin\i386");

            REngine.SetDllDirectory(GetRPath());
            REngine.SetDllDirectory(@"C:\Program Files\R\R-2.14.1\bin\i386");


            using (REngine engine = REngine.CreateInstance("RDotNet", new[] { "-q" }))  // quiet mode
            {
                // .NET Framework array to R vector.
                NumericVector group1 = engine.CreateNumericVector(new double[] { 30.02, 29.99, 30.11, 29.97, 30.01, 29.99 });
                engine.SetSymbol("group1", group1);
                // Direct parsing from R script.
                NumericVector group2 = engine.EagerEvaluate("group2 <- c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)").AsNumeric();

                // Test difference of mean and get the P-value.
                GenericVector testResult = engine.EagerEvaluate("t.test(group1, group2)").AsList();
                double p = testResult["p.value"].AsNumeric().First();

                string s1 = String.Format("Group1: [{0}]", string.Join(", ", group1));
                string s2 = String.Format("Group2: [{0}]", string.Join(", ", group2));
                string s3 = String.Format("P-value = {0:0.000}", p);

                senddebug(s1);
                senddebug(s2);
                senddebug(s3);
            }
        }
}

But I get an error of:

response threw exception: Could not load file or assembly ‘R.NET, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Can anyone help out to get around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:30:15+00:00Added an answer on June 16, 2026 at 8:30 pm

    if your ASP.NET application is 64 bit, then this might be useful 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.
    Most R packages dlls (except base package) are 32 bit, so it may be a source of the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with PDFs in VB.NET using a DLL I found on code project:
I've written a .NET DLL which is called from another application using COM interop.
I have downloaded the 3.4 version from here http://sourceforge.net/projects/pdcurses/files/pdcurses/ . I copied the pdcurses.dll
I am using a third party .Net dll in my code and when I
I have a c++ class which needs to interact with a .NET dll using
I've converted an api written in Java into a .net dll using IKVM, and
Using Visual Studio .NET 2003 C++ and the wininet.dll Am seeing many C4995 warnings
I am attempting to register a .dll using RegAsm. It is a .NET 2.0
Is it possible to extarct a .zip file using Zlib1.dll in the c#/.Net? Regards
I am having a problem with my code. I am using VB.NET and Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.