我有一个看起来像这样的代码:
var trimmedValue = value.Replace(" ", "");
var style = NumberStyles.Any;
if (BigInteger.TryParse(value, style, null, out BigInteger number))
{
// Run code
}
return new ValidationResult { Error = "Could not validate " + value + " as int." };
这在本地对我有用,它验证了 BigInteger。在 Azure 上,.TryParse返回 false 运行相同的值。任何人都知道为什么这对我在 Azure 上不起作用?我对 C# 很陌生,所以我不知道从哪里开始寻找。