【问题标题】:Could not load file for SmartsheetClient through Smartsheet SDK C#无法通过 Smartsheet SDK C# 为 SmartsheetClient 加载文件
【发布时间】:2019-05-15 18:00:18
【问题描述】:

我正在尝试在 C# 中使用 Smartsheet API 的 sdk 从 smartsheet 中获取行并将它们保存在其他地方。尝试初始化 SmartsheetClient 时,我收到 FileNotFoundException。我在 Postman 中使用了我的访问令牌,它可以工作。我是否需要指定有关客户端或令牌的任何内容才能进行初始化?

我正在使用 Visual Studio(社区 2019)在 C# 中工作,我已经安装了 smartsheet-csharp-sdk NuGet 包。我查看了 Smartsheet API 文档,并通过邮递员手动成功地执行了该过程。

//using System
//using Smartsheet.Api;
//using Smartsheet.Api.Models;
//using Smartsheet.Api.OAuth;
//using System.Net.Http;
//using System.Net;
//using System.Web;
//using System.Web.Http;

Token token = new Token();
token.AccessToken = "{my access token}";


SmartsheetClient smartsheet = 
    new SmartsheetBuilder().SetAccessToken(token.AccessToken).Build();

我希望 SmartsheetClient 能够初始化,以便我可以使用它来获取工作表中的数据,但它却引发了错误。

【问题讨论】:

    标签: c# smartsheet-c#-sdk-v2


    【解决方案1】:

    听起来您缺少依赖项。您可以查看 Visual Studio 中的“参考”部分以查看所需的程序集。可能会有警告显示缺少的内容。您可以考虑重新安装 SDK 以确保您已安装所有必要的依赖项。

    【讨论】:

    • 谢谢,我现在发现了问题。
    • 太好了!我很高兴听到这个消息。
    猜你喜欢
    • 1970-01-01
    • 2018-05-06
    • 2015-11-28
    • 2020-04-03
    • 2018-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    相关资源
    最近更新 更多