You need to first create a new class that implements IFacebookApplication.
private class RequestScopedFacebookApplication : IFacebookApplication { private IFacebookApplication Current { get { var url = HttpContext.Current.Request.Url; var app = GetSettingsForUrl(url); return app; } } public string AppId { get { return Current.AppId; } } }
Then in Application_Start from global.asax install the facebook application.
public void Application_Start() { FacebookApplication.SetApplication(new RequestScopedFacebookApplication()); }
UPDATE: The following is an additional sample implementation: https://gist.github.com/820881
source share