bmresearch / Solnet.Metaplex

Metaplex Protocol .NET integration library.
MIT License
35 stars 20 forks source link

[Bug] Could not load type 'Solnet.Rpc.Utilities.AddressExtensions' from assembly 'Solnet.Rpc #39

Closed ohaddahan closed 2 years ago

ohaddahan commented 2 years ago

Describe the bug Getting the following excepton:

Unhandled exception. System.TypeLoadException: Could not load type 'Solnet.Rpc.Utilities.AddressExtensions' from assembly 'Solnet.Rpc, Version=6.0.6.0, Culture=neutral, PublicKeyToken=null'.
   at Solana.Metaplex.MetadataAccount.GetAccount(IRpcClient client, PublicKey pk)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Solana.Metaplex.MetadataAccount.GetAccount(IRpcClient client, PublicKey pk)

To Reproduce

    var rpcClient = ClientFactory.GetClient(Cluster.DevNet, null);
    var tokenAccounts = rpcClient.GetTokenAccountsByOwner("A4dqTiSyoQPYaYKgz7KMC4KbsA7Hw4o1W9edXa949zzT", null,
        "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");

    Task.Run(async () =>
    {
        foreach (TokenAccount accountPk in tokenAccounts.Result.Value)
        {
            var mint = accountPk.Account.Data.Parsed.Info.Mint;
            var account = await MetadataAccount.GetAccount(rpcClient, new PublicKey(mint));
        }
    }).GetAwaiter().GetResult();

Installed versions:

image

Expected behavior Not to crash.

Desktop (please complete the following information): Macbook Pro latest OS.

ohaddahan commented 2 years ago

FYI examples show as Solnet.Metaplex and NuGet is Solana.Metaplex.

ohaddahan commented 2 years ago

Never mind, had to install it manually, that Solana.Metaplex package is confusing.

aibalamar commented 2 years ago

I have the same problem with the same versions of nuget but I can't solve it by installing it manually, maybe I'm doing it wrong, but I can't find the Solnet.Rpc.Utilities.AddressExtensions class documented here

imagen

BifrostTitan commented 2 years ago

Updated the nuget package with the latest source. Try again after updating the package