2

I am using BigHexIntegers from a c# library called Nethereum. I need to use BigHexIntegers to add Ether to a transaction and set gas. I run into an issue however when I try to use these variable types as it recognises it is a variable inherited from Nethereum but it then tells me i need to add the assembly: System.Runtime.Numerics. I looked for this assembly in references but couldn't find it (except for System.Numerics which was already added). I found the package on Nuget and it was installed yet it still won't work as a reference.

Could it be that it is an entirely different problem all together?

Here is some of my code:

    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);
    }

and

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

Error Message:

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'.
James
  • 343
  • 4
  • 21
  • http://stackoverflow.com/questions/20660999/the-type-is-defined-in-an-assembly-that-is-not-referenced-how-to-find-the-cause You may find the answer here. :-) Good luck – Eranga Heshan Aug 26 '16 at 06:38

1 Answers1

1

You need to add the NuGet Nethereum.Hex (this is automatically included when you include the NuGet Nethereum.Web3.

Add then and add this using: using Nethereum.Hex.HexTypes; to the source code file.

Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121