gpt4 book ai didi

c# - 返回 NULL 的 Trello.NET 对象

转载 作者:太空狗 更新时间:2023-10-30 01:34:15 25 4
gpt4 key购买 nike

@dillenmeister我尝试了 Trello.NET 包装器,但它在成功接受 AppKey 和 Token 后总是返回 NULL。我确定 AppKey 和 Token 是正确的,因为当我故意输入错误的 AppKey/Token 时,我得到了错误。

我安装的软件包版本是:

Trello.NET 0.6.2杰森.NET 7.0.1RestSharp 105.1.0

以下是类级别的程序集引用:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TrelloNet;
using RestSharp;
using Newtonsoft.Json.Serialization;

public partial class TestTrello : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ITrello trello = new Trello("[AppKey]");

trello.Authorize("[Token]");

// Get a board
Board theTrelloDevBoard = trello.Boards.WithId("[boardId]");
string boardName = theTrelloDevBoard.Name;
}

}

那么,我缺少什么才能让它发挥作用?

最佳答案

看起来有 a color enumis missing some colors .当您尝试下载板数据时,这会导致异常。有 several pull requests open 来纠正这个问题,但是创建者还没有合并一个,可能是因为所有的 PR 导致测试套件失败。

作为快速解决方法,您可以克隆存储库:

git clone https://github.com/dillenmeister/Trello.NET.git

更新 Cards\Color.cs 文件

public enum Color
{
Green, Yellow, Orange, Red, Purple, Blue, Turquoise, Lightgreen, Pink, Sky, Lime, Black
}

..然后在 Visual Studio 中构建项目。将生成的 TrelloNet.dll 作为引用添加到您的项目中,您应该能够获取看板数据。

更新

通过@ajwaka 的评论:Nuget 有 TrelloNet.Temp.Fork由同一个开发人员开发,它似乎有效。

关于c# - 返回 NULL 的 Trello.NET 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31447368/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com