Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Can't create a new client #51

Open
ZioZen opened this issue Sep 1, 2020 · 3 comments
Open

Can't create a new client #51

ZioZen opened this issue Sep 1, 2020 · 3 comments

Comments

@ZioZen
Copy link

ZioZen commented Sep 1, 2020

Hi,
I'm trying to create an app that use this api, but when i try to create a new client the program crash and tell me "System.ArgumentNullException: 'Value cannot be null.
Parameter name: path1
"

This is the code that I used:

            var settings = new FactorySettings
            {
                AppHash = "0f5b4xxxxxxxxxxxxxxxca4d4",
                AppId = 1xxxxxx8,
                ServerAddress = "149.154.167.40",
                ServerPublicKey = @"-----BEGIN RSA PUBLIC KEY-----
.
.
.
-----END PUBLIC KEY-----",
                ServerPort = 443,
                SessionTag = "session", // by defaut
                Properties = new ApplicationProperties
                {
                    AppVersion = "1.0.0", // You can leave as in the example
                    DeviceModel = "PC", // You can leave as in the example
                    LangCode = "en", // You can leave as in the example
                    LangPack = "tdesktop", // You can leave as in the example
                    SystemLangCode = "en", // You can leave as in the example
                    SystemVersion = "Win 10 Pro" // You can leave as in the example
                }
            };
            // Create the client
            var clientApi = await ClientFactory.BuildClientAsync(settings).ConfigureAwait(true);

I don't know from where this path1 came from, and how to fix it.

@KoalaBear84
Copy link

I have the exact same code and have no problems. Do you have any inner exceptions?

@ZioZen
Copy link
Author

ZioZen commented Sep 1, 2020

No, I don't have any inner exceprion.
I put the code inside a try-cath and this is the error that I have:

System.ArgumentNullException: Value cannot be null.
Parameter name: path1
at System.IO.Path.Combine (System.String path1, System.String path2) [0x00003] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.IO/Path.cs:102
at OpenTl.ClientApi.Settings.FileSessionStore.SetSessionTag (System.String sessionTag) [0x00024] in <7438c12f34b74c58b06c1f081256b9c1>:0
at OpenTl.ClientApi.ClientFactory.FillSettings (Castle.Windsor.IWindsorContainer container, OpenTl.ClientApi.IFactorySettings factorySettings) [0x0011e] in <7438c12f34b74c58b06c1f081256b9c1>:0
at OpenTl.ClientApi.ClientFactory.BuildClientAsync (OpenTl.ClientApi.IFactorySettings factorySettings) [0x0004c] in <7438c12f34b74c58b06c1f081256b9c1>:0
at InventoryBotMinerApp.MainPage.StartConnection (System.Object sender, System.EventArgs args) [0x000dc] in D:\Programmazione\InventoryBotMinerApp\InventoryBotMinerApp\MainPage.xaml.cs:174 }

Is possible that the problem is the ServerPublicKey? I put the entire key, and it give me the error; I try with only the RSA PUBLIC KEY, and I have the same problem...

@KoalaBear84
Copy link

KoalaBear84 commented Sep 2, 2020

I know that part is very strict. I have it exactly like this:

                string rsaPublicKey = @"-----BEGIN RSA PUBLIC KEY-----
MIIBC****
ly****
aq***
EfD****
8j****
Slm****
-----END RSA PUBLIC KEY-----";

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants