特雷洛.NET对象返回NULL

本文关键字:返回 NULL 对象 NET 雷洛 | 更新日期: 2023-09-27 18:03:10

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

我安装的软件包版本是:

特雷洛。净额0.6.2Json。净额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;
    }
}

那么,我错过了什么来让它工作呢?

特雷洛.NET对象返回NULL

看起来有一个颜色枚举缺少一些颜色。当你试图下载电路板数据时,这会导致一个异常。有几个pull请求打开来纠正这个问题,但创建者还没有合并一个,可能是因为所有的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由同一个开发人员开发,它似乎可以工作。