Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

All requests returning null #53

Open
rmorrin opened this issue Jul 31, 2014 · 16 comments
Open

All requests returning null #53

rmorrin opened this issue Jul 31, 2014 · 16 comments

Comments

@rmorrin
Copy link

rmorrin commented Jul 31, 2014

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
@rmorrin
Copy link
Author

rmorrin commented Aug 1, 2014

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!

@bcwood
Copy link

bcwood commented Oct 16, 2014

Thanks so much for this! I just spent way too much time going down a rabbit hole trying to figure this one out.

@takemyoxygen
Copy link

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 #57

@rmorrin
Copy link
Author

rmorrin commented Nov 24, 2014

@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.

@takemyoxygen
Copy link

@rmorrin, thanks. Actually, #61 is my pull-request, so it resolved my problem.

@rmorrin
Copy link
Author

rmorrin commented Nov 24, 2014

@takemyoxygen So it is - missed that one! Glad it's sorted 😄

@JaCraig
Copy link

JaCraig commented Dec 3, 2014

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.

@jpatte
Copy link

jpatte commented Dec 29, 2014

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.

@JaCraig
Copy link

JaCraig commented Dec 30, 2014

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
#53 (comment)
.

@toddel
Copy link

toddel commented Feb 6, 2015

Facing the same issue, seems to be related with board objects only
IEnumerable 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 allCardsAssignedToMe = trello.Cards.ForMember(trello_me); //Works fine

Any solution yet?

TrelloNet: 0.6.2.
Json: 6.0.0
RestSharp: 105.0.1

@edmundg
Copy link

edmundg commented May 26, 2015

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

@JaCraig
Copy link

JaCraig commented May 26, 2015

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.

@edmundg
Copy link

edmundg commented May 26, 2015

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.

@garfbradaz
Copy link

Thanks! I used the Edge version - was that correct?

@russlamb
Copy link

russlamb commented Aug 1, 2017

i updated my JSON package with the command

Install-Package Newtonsoft.Json

now i'm able to call some functions:

  1. trello.Members.Me()
  2. Organizations.ForMember()

I still get null sets for:

  1. Boards methods
  2. Cards methods
  3. 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.

@russlamb
Copy link

russlamb commented Aug 1, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants