Profile picture Schedule a Meeting
c a n d l a n d . n e t

Facebook.NET Configuration Section

Dusty Candland | |

I’m checking out the Facebook.NET libraries, and find the documentation to be very lacking. I could be looking in the wrong places. Anyway, to setup the configuration section, you need to reference the FacebookNET.Web.dll. Then in your config file add a section entry to the configSections tag like:

<section name="facebook" type="Facebook.Web.Configuration.FacebookSection, FacebookNET.Web" allowDefinition="MachineToApplication"/>

Then add the Facebook section with your info to the configuration tag:

<facebook>
    <application name="Facebook.NET App" apiKey="[App Key]" secret="[Secret]"/>
</facebook>

That's it. Now you can access that info from code like:

var fbSection = (FacebookSection)ConfigurationManager.GetSection("facebook");
var secret = fbSection.Applications["Facebook.NET App"].Secret;

Webmentions

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site: