IFrame app error: Requested value 'CentristParty' was not found.

Oct 23, 2008 at 5:36 AM
Hi,

I've just downloaded the facebook dev toolket 2.0 and tried creating as simple app using the friend list control and i seem to get the following error when i view the webpage:

Requested value 'CentristParty' was not found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Requested value 'CentristParty' was not found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Requested value 'CentristParty' was not found.]
System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) +2717319
Facebook.Parser.UserParser.ParseUser(XmlNode node) +1247
Facebook.API.FacebookAPI.GetUserInfo(String userIds) +277
Facebook.Components.FacebookService.GetFriends() +98
_Default.Page_Load(Object sender, EventArgs e) +513
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint

I've tried downgrading to versions 1.7, 1.6 & 1.3 and i get the same issue...any ideas what i'm doing wrong?

Thanks,

JC
Oct 23, 2008 at 5:52 AM
Looking at your Stack Trace there it looks like it's loaded up the friends then while parsing one of the users has come across the "CentristParty" string.  Maybe you have a friend with that as their religion or something.

Whack a Try/Catch around your GetFriends call so you don't get a big fat nasty yellow ASP.NET error page plus try stepping through in debug mode so you can see what the values are for each of the returned friends.
Oct 23, 2008 at 6:34 AM
The error happens when i do this:

Collection<Facebook.Entity.User> friends = _fbService.GetFriends();

I assume i'll have to recompile the Facebook binaries to handle this odd value name?

Cheers for your help.
Oct 23, 2008 at 6:49 AM
fixed the issue, the UserParser.cs in the Facebook.dll was using types for the political views and i think one of my friends has a custom political view entry so i just removed the enum for this field and recompiled the facebook.dll

if (!String.IsNullOrEmpty(XmlHelper.GetNodeText(node, "political")))
{
user.PoliticalView = (PoliticalView)Enum.Parse(typeof(PoliticalView), XmlHelper.GetNodeText(node, "political").Replace(" ", ""), true);
}


Oct 23, 2008 at 2:05 PM
see http://www.codeplex.com/FacebookToolkit/Thread/View.aspx?ThreadId=37438

there is a link to my binary if you want it as well