Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tron.Net.Crypto.ECKey exception #1

Open
otakuinny opened this issue Sep 8, 2018 · 7 comments
Open

Tron.Net.Crypto.ECKey exception #1

otakuinny opened this issue Sep 8, 2018 · 7 comments
Labels
invalid This doesn't seem right

Comments

@otakuinny
Copy link

Hello.
I installed the Tron.Net.Client library from the following URL
https://www.nuget.org/packages/Tron.Net.Client

The following line is throwing an error.
Tron.Net.Client.WalletAddress newAddress = Tron.Net.Client.WalletAddress.MainNetWalletAddress();

Error:
The type initializer for ‘Tron.Net.Crypto.ECKey’ threw an exception.
at Tron.Net.Crypto.ECKey..ctor()
at Tron.Net.Client.WalletAddress.MainNetWalletAddress(ECKey key)
at TelegramBot.TRON.TRON.TestTRON() in ………

Also, the lib BouncyCastle.Crypto wasn't included in the above nuget pakage.

Thanks for your help.

@dariogriffo
Copy link
Contributor

Which framework are you targeting?

@dariogriffo
Copy link
Contributor

I have tried creating a new WalletAddress with a .net core and .net 4.7.1 framework
This is the code

Tron.Net.Client.WalletAddress newAddress = Tron.Net.Client.WalletAddress.MainNetWalletAddress();
Console.WriteLine(newAddress.IsMainNet);

All the dependencies where correctly installed
in both projects, from command line:

install-package Tron.Net.Client

@dariogriffo dariogriffo added the invalid This doesn't seem right label Sep 9, 2018
@otakuinny
Copy link
Author

otakuinny commented Sep 9, 2018

Hello. My project is targeting .Net 4.5 Framework. I first installed the Tron.Net.Protocol from the following NuGet command
Install-Package Tron.Net.Protocol -Version 1.2.2

And then Tron.Net.Client from the following NuGet command
Install-Package Tron.Net.Client -Version 0.6.3

I could use all the other methods just fine. Only the following code is giving me trouble
Tron.Net.Client.WalletAddress newAddress = Tron.Net.Client.WalletAddress.MainNetWalletAddress(); Console.WriteLine(Tron.Net.Common.Utils.ToHexString(newAddress.Value));

@otakuinny
Copy link
Author

Hello. I changed my project target to 4.7.1 and I'm still receiving the following error.
Tron.Net.Client.WalletAddress newAddress = Tron.Net.Client.WalletAddress.MainNetWalletAddress(); Console.WriteLine(Tron.Net.Common.Utils.ToHexString(newAddress.Value));

Error:
The type initializer for ‘Tron.Net.Crypto.ECKey’ threw an exception.
at Tron.Net.Crypto.ECKey..ctor()
at Tron.Net.Client.WalletAddress.MainNetWalletAddress(ECKey key)
at TelegramBot.TRON.TRON.TestTRON() in ………

@otakuinny
Copy link
Author

I've tried with several .net frameworks starting at .net4.5 all the way to .net 4.7.2. It is the same error
Tron.Net.Client.WalletAddress newAddress = Tron.Net.Client.WalletAddress.MainNetWalletAddress(); Console.WriteLine(Tron.Net.Common.Utils.ToHexString(newAddress.Value));

Error:
The type initializer for ‘Tron.Net.Crypto.ECKey’ threw an exception.
at Tron.Net.Crypto.ECKey..ctor()
at Tron.Net.Client.WalletAddress.MainNetWalletAddress(ECKey key)
at TelegramBot.TRON.TRON.TestTRON() in ………

@otakuinny
Copy link
Author

Here are the references. The target framework is 4.7.1
untitled

@mojtaban12
Copy link

mojtaban12 commented Aug 5, 2020

hi
i'm using .net core3.1
WalletAddress address = Tron.Net.Client.WalletAddress.MainNetWalletAddress(); string privateKey = Tron.Net.Common.Utils.ToHexString(address.Value);
and then !
FileNotFoundException: Could not load file or assembly 'Tron.Net.Crypto, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants