GetFriends() broken - v1.x API broken since yesterday night??!!

Oct 10, 2008 at 8:29 AM
All my users get this kind of errors ,  any ideas?
**
Error Message:
Requested value 'doesitreallymatter?' was not found.
Stack Trace:
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Facebook.Parser.UserParser.ParseUser(XmlNode node) at Facebook.API.FacebookAPI.GetUserInfo(String userIds) at Facebook.Components.FacebookService.GetUserInfo() at _Default.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at

***
Error Message: Requested value 'DemocraticParty' was not found.
Stack Trace:
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Facebook.Parser.UserParser.ParseUser(XmlNode node) at Facebook.API.FacebookAPI.GetUserInfo(String userIds) at Facebook.Components.FacebookService.GetUserInfo() at _Default.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at
Oct 10, 2008 at 1:48 PM

it crashes here:

Me

 

.FBService.GetFriendsAppUsers()


I use APi 1.6

 

Oct 10, 2008 at 2:19 PM
i am getting this as well. Using version 1.7

Is there anyway to get the toolkit to spit out the xml in case of an error so that we can actually see the returned strucutre from FB?

PS - this is happening for some logins only. It *could* be some FB issues
Oct 10, 2008 at 2:24 PM
If someone can tweak .DLLs and fix this, please share the DLL with all of us,   I cannot compile the c#  DLLs with my machine   :(
Oct 10, 2008 at 2:30 PM
i can tweek the dlls but i am using a different version.

Still, deploying tweeked dlls to a production site just like that is not by idea of a good day :)
Oct 10, 2008 at 3:09 PM
zik, this seems to be due to Political View.

I guess FB not allows a free form entry in this field while the old toolkit exepcted this to be a predefined value, an enum.

You can find this in Facebook.Parser.UserParser:

 

//user.PoliticalView = (PoliticalView)Enum.Parse(typeof(PoliticalView), XmlHelper.GetNodeText(node, "political").Replace(" ", ""), true);

I just commnted out this peace of code and it works.

 

Oct 10, 2008 at 6:44 PM
I'm testing a fix with my pseudo 1.6+ code.  Let me know if you are interested in the dlls.

-Sean
Oct 13, 2008 at 8:33 AM
Sean, it would be great if you can place the fixed DLLs available somewhere  so download (http/ftp).

PS: Reason I cannot compile is that I have only Visual Web Developer 2008  Express installed.
Oct 13, 2008 at 1:26 PM
"PS: Reason I cannot compile is that I have only Visual Web Developer 2008  Express installed. "

Considering the type of project this is (ie, open source), I would strongly suggest you get vs 2008 as very soon there may be more critical issues. verion 1.7 may be supported as other like me are using it, version 2 may also be updated but I doubt 1.6 would.. .
Oct 13, 2008 at 1:38 PM
got it working now;  I dont have VS2008 and was in hurry,  so I just used hex-editor to remove this call from facebook.dll

  
Oct 13, 2008 at 1:58 PM
WOW! well, THAT is determination :) 

I certainly hope we can all move to 2.0 soon so that these types of hacks are not necessary...
Oct 14, 2008 at 6:14 AM
My users also started getting this problem today.  I get an argument exception when calling GetFriends() with the following stack trace:


at System.Enum.Parse()
at Facebook.Parser.UserParser.ParseUser()
at Facebook.API.FacebookAPI.GetUserInfo()
at Facebook.API.FacebookAPI.GetFriends()
at Fidgt_for_WM_Professional.ContactManager.GetFacebookContacts()
at Fidgt_for_WM_Professional.ContactManager.SignIn()


What changed today?  Do I have to change the Facebook SDK source and rebuild the DLL to get around this issue?  Is it just the Political View field?

Dick
Oct 14, 2008 at 7:42 AM
Dick, this is a same problem we discussed above,  easiest way is to tweak the DLL just a little,   I decided to use hex editor to avoid recompiling.

Download any hex editor and tweak like this  (bytes below are for ver 1.6  only!) :

C:\temp\Binaries>fc /b Facebook.dll FacebookWebSample\Bin\Facebook.dll
Comparing files Facebook.dll and FACEBOOKWEBSAMPLE\BIN\FACEBOOK.DLL
0001897A: AA 6F
0001897C: AA 6C
Oct 17, 2008 at 8:54 PM
sean - my v1.7 GetFriends() was broken too. could i get and use your dll? thanks in advance.
Oct 17, 2008 at 9:44 PM
I have changed the source code to comment out the statement that tries to parse the Political View field with an Enum, so, now it does not throw an exception.  However, this means that my dll will always show a users Political View as Unknown.  If you can live with that, you are welcome to the dll.

Dick
Oct 17, 2008 at 10:02 PM
Edited Oct 20, 2008 at 4:53 PM
thanks, dick. where where can i get your dll? my email address is xx. thanks, i got the dll, and it works fine.
Oct 18, 2008 at 11:10 PM
The dll that I generated is for .Net Compact Framework and Facebook Control V1.7.  I can generate one for a different environment but I need to know what do you need?

Dick
Oct 19, 2008 at 1:36 PM
For anyone who is interested, here are the binaries with the political view code commented out. http://www.realmofempires.com/downloads/facebook.dll.zip

This is based on version 1.7 with some of my modifications ( some more error handling) and a new FBService.GetFriendsAppUsersList() that returns friends IDs in a comma seperated list ending with a trailing comman.

use at your own risk