Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Blockchain by (4.1k points)

I'm a beginner of C# and blockchain.

I'm studying blockchain with "Programming The Blockchain in C#". I tried to run this source code following the book:

using NBitcoin;
using QBitNinja.Client;
using QBitNinja.Client.Models;

namespace NBitcoinTest1
    class Program
        static void Main(string[] args)
        // Create a client
        QBitNinjaClient client = new QBitNinjaClient(Network.Main);
        // Parse transaction id to NBitcoin.uint256 so the client can eat it
        var transactionId = uint256.Parse("f13dc48fb035bbf0a6e989a26b3ecb57b84f85e0836e777d6edf60d87a4a2d94");
        // Query the transaction
        GetTransactionResponse transactionResponse = client.GetTransaction(transactionId).Result;

But it doesn't work because of exception. It says "Method 'System.Net.Logging.get_On' not found.", so I tried to find "System.Net.Logging", but I couldn't find any package named "System.Net.Logging" in

How can I solve this problem?

Environment: macOS Sierra 10.12.6, Visual Studio for Mac[Community] 7.2(Build 636)

1 Answer

0 votes
by (14.4k points)

Your problem relies on the conflicting types of NBitcoin dependencies. You have installed NBitcoin first, and then installed QBitNinja which runs atop NBitcoin. So, delete the first dependency version which is v3. 

Everything should work then. 

Browse Categories