【问题标题】:Can I use Math.NET runtimes with a .NET 2.0 or .NET 3.5 application?我可以将 Math.NET 运行时与 .NET 2.0 或 .NET 3.5 应用程序一起使用吗?
【发布时间】:2011-11-10 20:44:01
【问题描述】:

我刚刚下载了最新版本的 Math.NET,但在使用时遇到了一些问题。

该库可能是为了在 .NET 4.0 项目上运行吗?

更新:

编译后的 dll 位于“Net40”文件夹中,这是否意味着我无法在 2.0 项目中引用它?

尝试了这段代码,我得到了一个TypeLoadException(VS2008,目标框架 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);
        }
    }
}

【问题讨论】:

  • 我猜你的意思是:mathdotnet.com
  • 您遇到的错误是什么?
  • 我相信当使用 .NET 4.0 System.Numerics dll 的特定方法时出现此错误,因为它是在 2.0 应用程序中运行的 4.0 dll。

标签: c# .net math.net mathnet-numerics


【解决方案1】:
  • Math.NET Numerics:.Net 4 或更高版本,便携式版本:Silverlight 5 或更高版本,Metro
  • Math.NET Iridium(Numerics 的前身):.Net 2 或更高版本

2013-12-14 更新:从 v3 开始,Math.NET Numerics 也再次支持 .Net 3.5。

【讨论】:

    【解决方案2】:

    根据文档:

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

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

    它需要 .NET 2.0

    【讨论】:

      猜你喜欢
      • 2010-10-16
      • 1970-01-01
      • 1970-01-01
      • 2022-07-20
      • 2010-12-10
      • 1970-01-01
      • 2010-10-23
      • 2023-04-01
      • 1970-01-01
      相关资源
      最近更新 更多