gpt4 book ai didi

c# - System.Runtime.Numerics BigHexInteger 不工作

转载 作者:太空宇宙 更新时间:2023-11-03 12:40:31 28 4
gpt4 key购买 nike

我正在使用来自名为 Nethereum 的 c# 库的 BigHexIntegers。我需要使用 BigHexIntegers 将以太币添加到交易中并设置气体。但是,当我尝试使用这些变量类型时,我遇到了一个问题,因为它识别出它是从 Nethereum 继承的变量,但它随后告诉我我需要添加程序集:System.Runtime.Numerics。我在引用资料中查找了这个程序集,但找不到(除了已经添加的 System.Numerics)。我在 Nuget 上找到了这个包,它已经安装了,但它仍然不能作为引用。

这会不会是一个完全不同的问题?

这是我的一些代码:

    protected async void ethpobButton_Click(object sender, EventArgs e)
{
var gas = new HexBigInteger("60000");
var value = new HexBigInteger(ethAmountTextBox.Text);

var proofOfBurn = Reputation.GetFunction("burnCoins");
var result = await proofOfBurn.SendTransactionAsync(ethAddrTextBox.Text, gas ,value);
}

using System;
using NBitcoin;
using QBitNinja.Client;
using Nethereum.Hex.HexTypes;

错误信息:

Compiler Error Message: CS0012: The type 'BigInteger' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

最佳答案

您需要添加 NuGet Nethereum.Hex (这会在您包含 NuGet Nethereum.Web3 时自动包含在内。

然后添加并使用:using Nethereum.Hex.HexTypes; 添加到源代码文件中。

关于c# - System.Runtime.Numerics BigHexInteger 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39157310/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com