Trello.NET
Trello.NET copied to clipboard
All requests returning null
Hi there,
I've tried a number of the examples from the wiki, and am unfortunately unable to get any usable data back from the API. I've debugged the request itself and can definitely see the raw JSON coming back, so maybe be an issue deserializing the response?
Simplified example:
var trello = new Trello(ConfigurationManager.AppSettings["TrelloAPIKey"]);
trello.Authorize(ConfigurationManager.AppSettings["TrelloAPIToken"]);
Board theTrelloDevBoard = trello.Boards.WithId("4d5ea62fd76aa1136000000c"); // null
After a bit more investigation, the issue seems to be caused by the version of Json.NET (4.5.11) included in the default MVC web project. Updating the Json.NET package resolves the issue.
The exception thrown inside RestSharp is:
Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The issue can be reproduced by the following (Assuming VS2013):
- Create new ASP.NET Web Application
- Select MVC template
- Install Trello.NET via NuGet
- Attempt to retrieve any data from Trello - see previous comment
Hope this helps!
Thanks so much for this! I just spent way too much time going down a rabbit hole trying to figure this one out.
What version of Newtonsoft.Json did you use? I had nulls with 4.5.1 and nothing changed after I upgraded to 6.0.6 This line returns null, however some JSON is coming back from the server:
trello.Boards.ForMe()
Just tried to debug Trello.NET source code and got an exception
Could not convert string 'pink' to dictionary key type 'TrelloNet.Color'
So it looks like this issue might be related to https://github.com/dillenmeister/Trello.NET/issues/57
@takemyoxygen Not entirely sure on the version - It would have been the latest version at that date. Though from what I can tell, I think the issue you're experiencing is due to something different.
I did notice there have been a number of PRs submitted to address the new label colors (#61, #58) but the maintainer has yet to respond to either. Perhaps you could could merge them into your own build and see if that resolves things.
@rmorrin, thanks. Actually, #61 is my pull-request, so it resolved my problem.
@takemyoxygen So it is - missed that one! Glad it's sorted :smile:
Since it's been a couple days and we needed this fix for work, we pushed up a version to NuGet with takemyoxygen's fix: https://www.nuget.org/packages/TrelloNet.Temp.Fork/
I'm planning on taking it down once dillenmeister pushes up a fixed version but just figured I would share in case someone needed the fix now.
Hi James, Are you sure you uploaded the right binaries on Nuget ? The package you linked does not seem to contain takemyoxygen's fix. Its behavior is identical to Trello.NET 0.6.2's official package.
We're using the DLLs in production at the moment without issue and our build server pulls from Nuget before it deploys. Takemyoxygen's fix only deals with the new color options that Trello added so if you're running into another issue that's not related to that, you're going to get back null data because that's what Trello.Net seems to do for any issue that isn't a failed request.
On Mon, Dec 29, 2014 at 11:16 AM, Julien Patte [email protected] wrote:
Hi James, Are you sure you uploaded the right binaries on Nuget ? The package you linked does not seem to contain takemyoxygen's fix. Its behavior is identical to Trello.NET 0.6.2's official package.
— Reply to this email directly or view it on GitHub https://github.com/dillenmeister/Trello.NET/issues/53#issuecomment-68270866 .
Facing the same issue, seems to be related with board objects only IEnumerable<Board> allMyBoards = trello.Boards.ForMember(trello_me); // returns null Board theTrelloDevBoard = trello.Boards.WithId("4d5ea62fd76aa1136000000c"); // returns null var myBoard = trello.Boards.Add("My Board"); // returns null, board is added though
But: IEnumerable<Card> allCardsAssignedToMe = trello.Cards.ForMember(trello_me); //Works fine
Any solution yet?
TrelloNet: 0.6.2. Json: 6.0.0 RestSharp: 105.0.1
I am currently having to use the "Trello.NET (temp fork)" package which seems to have this fix (or at least from the api calls I am using so far).
Is there any time-scale on this getting folded in?
Thanks, Ed
No idea. I'm the one that pushed that package up because I figured that dillenmeister would have a fix in a month or two and we just needed something where I worked right then and there (I was going to hide it once this was patched up). But this project hasn't been updated in about a year so no idea if he's going to update this or not. A couple people where I work tried contacting him also to see if we could help out but didn't get a response. So maybe dead project? Maybe he's really busy? Not sure at this point.
Thanks jacraig for letting me know and good work with the fix it's been very helpful.
Would be nice if the project can be kept alive somehow or revived in a different location but I'm new to github so not sure how any of that could work.
Thanks! I used the Edge version - was that correct?
i updated my JSON package with the command
Install-Package Newtonsoft.Json
now i'm able to call some functions:
- trello.Members.Me()
- Organizations.ForMember()
I still get null sets for:
- Boards methods
- Cards methods
- List methods (because no boards)
If I pass my board id to the test API using my key and token i get a result. So I think I'm not crazy.
Amazingly, I didn't realize this code hasn't been updated since 2014.
Other people have suggested Manatee.Trello or using the "Edge" version on NuGet. I'm going to try manatee. It was last updated in June 2017 as of this comment.