简体   繁体   中英

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);
        }
    }
}

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM