'ASP.Facebook' does not contain a definition for 'FacebookSettings'
I'm using the Facebook C# SDK. My site was working fine yesterday.
This morning on running a build I'm getting:
'ASP.Facebook' does not c开发者_如何学Goontain a definition for 'FacebookSettings'
I've no ideas what caused this, can anyone help?
ok undid what i did yesterday which was to basically install the microsoft web helper package from nuget. not sure why this conflicted - perhaps there is a workaround?
This was caused by a change in the SDK from 4.x to 5.x
The methods to access the Facebook settings from the config file changed, so your code should change from this:
FB.init({ appId: '<%:FacebookSettings.Current.AppId %>', status: true, cookie: true, xfbml: true });
to this:
FB.init({ appId: '<%: Facebook.FacebookContext.Current.AppId %>', status: true, cookie: true, xfbml: true });
Hope this helps.
精彩评论