簡體   English   中英

在ASP.NET 5類庫中找不到System.Math命名空間

[英]Can't find System.Math namespace in ASP.NET 5 Class Library

我正在嘗試構建一個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

我在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"
        }
    }
}

添加對System.Runtime.Extensions的引用

使用“ 包搜索”查找包含特定類型的包

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM