在ASP.NET 5类库中找不到System.Math命名空间

Alk*_*sai 2 c# asp.net class-library asp.net-core

我试图建立一个ASP.NET 5类库,它使用一些方法从 System.Math,即System.Math.Round(...),System.Math.Sqrt(...) 等等.

当我尝试构建它时.我收到以下错误:

Error   CS0103  The name 'Math' does not exist in the current context   ProjectName.ASP.NET Core 5.0    Class1.cs
Run Code Online (Sandbox Code Playgroud)

我已经包括在project.json文件中的一些包来修复其他错误,与System.LinqSystem.Collections.Generic,但我不精包含一个包System.Math.

我在哪里可以找到它?

这是我的project.json文件:

"version": "1.0.0-*",
"dependencies": {
},
"frameworks" : {
    "aspnet50" : { 
        "dependencies": {
        }
    },
    "aspnetcore50" : { 
        "dependencies": {
            "System.Runtime": "4.0.20-beta-22416",
            "System.Collections": "4.0.10-beta-22416",
            "System.Linq": "4.0.0-beta-22416",
            "System.Threading": "4.0.0-beta-22416"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Vic*_*aci 9

添加引用 System.Runtime.Extensions

使用" 包搜索"查找包含特定类型的包