Value was either too large or too small for an Int32

Jun 26, 2009 at 11:20 PM
Edited Jun 26, 2009 at 11:22 PM

Hey guys,

I've been getting this error more frequently of late (I assume due to more users having crazy long user IDs) and was wondering if anyone has fixed it or found a work around.  Here's the error message and my stack trace...

ErrorMessage = Value was either too large or too small for an Int32.
StackTrace = at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Convert.ToInt32(String value) at facebook.web.BasePageHelper.EstablishSession(String sessionKey, String userId, String authToken, Boolean retry) at facebook.web.BasePageHelper.LoadIFramePage() at facebook.web.BasePageHelper.LoadIFramePage(API FaceBookAPI, Boolean useSession, Boolean autoAdd, HttpRequest request, HttpResponse response, HttpSessionState session) at facebook.web.CanvasIFrameMasterPage.Page_Init(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 System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.UserControl.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any help would be great.

Jun 27, 2009 at 6:42 AM

It looks like you're trying to store a Facebook ID as an int within your app. Some time ago Facebook changed this field to be a 64 bit integer so you need to change your app to use long for any FBIDs.

Jun 27, 2009 at 7:51 AM

I changed all my Facebook IDs to nvarchar yonks ago (which is another reason why this bug annoys me).  The stacktrace shows the problem stems from facebook.web.BasePageHelper.EstablishSession() ... something in the toolkit's session starter buried deep in the facebook.web.CanvasIFrameMasterPage.

Jun 27, 2009 at 3:09 PM

What version of the toolkit are you using?

Jun 28, 2009 at 1:12 AM

I was running 2.1 b3 but have just grabbed the release version of 2.1 and will be putting a build of that up later today.

Aug 23, 2009 at 4:23 AM

Did 2.1 solve the problem? I just started seeing error reports with an identical stack trace.  I'm still on 2.0 -- hoping that 2.1 fixed it. If not, care to share where the problem code is?


Aug 25, 2009 at 9:15 PM

I am also using the same 2.1 build and getting the same error.  Do I need to pull the current version in source control?

Aug 26, 2009 at 2:32 PM

2.1 fixed the problem for me.

Sep 5, 2009 at 2:46 AM
dolowoyo wrote:

I am also using the same 2.1 build and getting the same error.  Do I need to pull the current version in source control?

dolowoyo... Was your problem resolved....?

Even I am using 2.1 but still getting the error.. :(

Sep 7, 2009 at 3:52 AM



an the older dll was deployed on the web server... that was causing the issue... 2.1 has fixed the issue...

Sep 10, 2009 at 5:23 PM

Hey sassyboy,

Yea, I was able to fix my issue by making adjustments to the toolkit.  But it seems you have already found a solution as well.