1

Closed

"ClientID required" exception because FacebookApplication.Current is not set by FacebookWebContext

description

For the description of the issue and for a workaround see: http://facebook.stackoverflow.com/questions/7381370/facebook-c-sdk-oauth-exception-clientid-required/7386743

The problem is that when FacebookWebContext is instantiated with app settings then FacebookApplication.Current doesn't properly get set. The other way around: FacebookSession uses FacebookApplication.Current, but IMHO not a kind of global object should be used but the IFacebookApplication instance passed around.
Closed Oct 19, 2011 at 12:17 AM by prabirshrestha
fixed in v5.3

comments

prabirshrestha wrote Sep 12, 2011 at 12:59 PM

could you download the latest source code and check it out.
http://facebooksdk.codeplex.com/SourceControl/changeset/changes/7ce3c54e1aea

Piedone wrote Sep 12, 2011 at 3:50 PM

Wow, thank your for the very quick reply and fix! Because it was indeed a fix: authentication now works as expected.

prabirshrestha wrote Sep 12, 2011 at 4:53 PM

cool.
i will leave it as it is for now. you will need to manually build it. once we get more testers, will release a new version next week.

Piedone wrote Sep 12, 2011 at 8:39 PM

I've already built it and using the dll instead the ones I've downloaded from here. Thank you and the whole team for your efforts!

pragneshs9 wrote Jul 5, 2012 at 5:55 AM

Previously i was using facebook v5.2 with below code
var fbWebContext = new FacebookWebContext(FacebookApplication.Current, ControllerContext.HttpContext);
if (fbWebContext.IsAuthorized("user_about_me,publish_stream,email,user_status".Split(',')))
}
var fb = new FacebookWebClient(user.FacebookAccessToken);
                dynamic me = fb.Get("me");                    
                string first_name = me.first_name;

string last_name = me.last_name;

Above code was working fine but i have to add the offline_access for long live session it was expire with in 2 hours so i download the facebook v6 version. After updating the version the above code stops working.
Please give me the solution as early as possible.

pragneshs9 wrote Jul 5, 2012 at 6:36 AM

FacebookWebContext(IFacebookApplication settings, HttpContextBase httpContext)
I am not getting the IFacebookApplication interface. how can i pass the settings value.
Error:-
Could not load type 'Facebook.FacebookApplication' from assembly 'Facebook, Version=6.0.10.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de'.