[英]Can I add a reference to System.Core.dll (.net 3.5) to a .net 2.0 application and use it
[英]Can I use Math.NET runtimes with a .NET 2.0 or .NET 3.5 application?
我剛剛下載了最新版本的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);
}
}
}
更新2013-12-14:從v3開始,Math.NET Numerics也支持.Net 3.5。
根據文件:
http://www.mathdotnet.com/doc/BuildingMathNet.ashx
Ensure the Microsoft .NET Framework SDK 2.0 or newer is installed.
它需要.NET 2.0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.