1

我正在为我们的一个项目使用 Salesforce .Net 工具包。我已经为 Salesforce 客户端声明了一个静态变量

private static AuthenticationClient instance = null;

每当我的代码中的对象为空时,我都会初始化这个对象

await instance.UsernamePasswordAsync(client_id, client_secret, user_name, user_password, "https://login.salesforce.com/services/oauth2/token"); //Production

每当我尝试从 Salesforce 查询数据时,即使在成功验证后,我也会遇到错误

var client = new ForceClient(objService.InstanceUrl, objService.AccessToken, objService.ApiVersion);
var result = await client.QueryAsync<T>(soql);

错误是

System.ArgumentNullException: Value cannot be null. Parameter name: instanceUrl

任何可以帮助我解决此问题的人。

4

0 回答 0