Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 针对net45时的系统数值_C#_.net_Asp.net Core_Biginteger_Project.json - Fatal编程技术网

C# 针对net45时的系统数值

C# 针对net45时的系统数值,c#,.net,asp.net-core,biginteger,project.json,C#,.net,Asp.net Core,Biginteger,Project.json,据我所知,应该可以在Visual Studio 2015中使用新的xproj/project.json项目设置将net45作为目标。 因此,我创建了一个新项目,在文件->新建项目菜单的web模板下,编辑project.json和Class1.cs,如下所示 project.json: { "version": "1.0.0-beta8", "frameworks": { "net45": { "dependencies": { "System.Run

据我所知,应该可以在Visual Studio 2015中使用新的xproj/project.json项目设置将net45作为目标。 因此,我创建了一个新项目,在文件->新建项目菜单的web模板下,编辑project.json和Class1.cs,如下所示

project.json:

{
  "version": "1.0.0-beta8",

  "frameworks": {
    "net45": {
      "dependencies": {
        "System.Runtime.Numerics": "4.0.0"
      }
    }
  }
}
Class1.cs:

using System.Numerics;

namespace NumericTest
{
    public class Class1
    {
        public Class1()
        {
            var biginteger = BigInteger.Parse("1234567890");
        }
    }
}
我得到的错误是:

.NET Framework 4.5错误CS0234:类型或命名空间名称“Numerics” 命名空间“System”中不存在(是否缺少程序集 参考?)


如果我将目标框架更新为“dotnet”,它的编译就很好。但是,当我以net45为目标时,如何使用System.Numerics(更具体地说,是BigInteger类)?

尝试在项目中添加对
System.Numerics.dll
的程序集引用。

Doooh!塔克斯!当我这样做时,VS向我的project.json添加了一个frameworkAssemblies条目。非常感谢你!