Jonas
Jonas

Reputation: 1373

Can I use Math.NET runtimes with a .NET 2.0 or .NET 3.5 application?

I just downloaded the latest version of Math.NET and I'm running into some trouble when I use it.

Could it be that the library was meant to run on a .NET 4.0 project?

Update:

The compiled dlls are within a "Net40" folder, does that mean I cannot reference it in a 2.0 project?

Tried this code and I got an TypeLoadException (VS2008, target framework 3.5)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using MathNet.Numerics.LinearAlgebra.Double;

namespace MathNetTest
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            double[,] A = new double[3, 3];
            A[0, 0] = 1;
            A[0, 1] = 0.2;
            A[0, 2] = 1;
            A[1, 0] = 1.5;
            A[1, 1] = -1.2;
            A[1, 2] = 1.1;
            A[2, 0] = 0.45;
            A[2, 1] = 2.1;
            A[2, 2] = -0.76;

            Matrix XA = new DenseMatrix(A);
            Matrix XB = new DenseMatrix(A);

            Matrix C = (Matrix)(XA * XB);
        }
    }
}

Upvotes: 3

Views: 2381

Answers (2)

Christoph R&#252;egg
Christoph R&#252;egg

Reputation: 4736

Update 2013-12-14: Starting from v3, Math.NET Numerics supports .Net 3.5 again as well.

Upvotes: 4

McKay
McKay

Reputation: 12624

According to the documentation:

http://www.mathdotnet.com/doc/BuildingMathNet.ashx

Ensure the Microsoft .NET Framework SDK 2.0 or newer is installed.

It requires .NET 2.0

Upvotes: 1

Related Questions