MVC视图无法引用System.Numerics

时间:2019-03-21 00:41:15

标签: asp.net-mvc biginteger

使用MVC 5创建一个新的Razor View项目。

添加对System.Numerics的引用

在我的控制器中,我可以像这样使用BigInteger

using System.Numerics;
var bi = new BigInteger(100);

但是在我看来,我无法做到这一点:

@using System.Numerics
@{
    var bi = new BigInteger(100);
}

它一直抱怨没有引用System.Numerics。

1 个答案:

答案 0 :(得分:-1)

请在您的视图中使用此名称空间。在我的视图中,此名称有效。可能会对您有所帮助。

 @using Org.BouncyCastle.Math;
 @{
    BigInteger bi = new BigInteger("100");    
  }