raklos
raklos

Reputation: 28545

'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 contain a definition for 'FacebookSettings'

I've no ideas what caused this, can anyone help?

Upvotes: 1

Views: 736

Answers (2)

Andy Sinclair
Andy Sinclair

Reputation: 2303

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.

Upvotes: 1

raklos
raklos

Reputation: 28545

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?

Upvotes: 1

Related Questions