Sep
3
Facebook.net - develop ASP.NET based Facebook applications with ease
September 3, 2007 |
Nikhil Kothari my favorite Microsoft blogger has release a library for Facebook surprisingly called Facebook.net for creating Facebook applications in asp.net.
I have looked at several libraries since Facebook has opened up their api including Microsoft’s Facebook Developer Toolkit - Nikhil is a MS guy and is writing his own so enough said; and this is the best one I have seen which gives great access to the apis and provides nice controls which allow you to just start developing the meat of your application. The key to the library in my opinion is the ASP.NET server control, <fb:FacebookApplication> that manages the somewhat involved login/session-acquisition process.
Within Nikhil’s he also mentions an important gotcha where if you are developing locally you need to make the url’s within your development environment accessible by Facebook’s servers. His version:
An FBML application has to be hosted on the public internet, since Facebook’s server’s make request to it, as opposed to the browser. In the case of the IFrame approach, the user’s browser is the one making requests to your application, so it can be hosted on http://localhost and the debugger can be attached to the local process. I am not able to debug a remotely hosted application. Furthermore, any error information or exception message you send out from your application with an HTTP 500 status code turns into an unfriendly Facebook error saying something like “the makers of the app and Facebook are working out the kinks” - which is completely useless for debugging. So to help get debuggability back to at least printf/alert-style debugging, the FacebookApplication does a couple of things: it has an EnableDebugging property you can set to true when debugging, and in that mode, it catches unhandled exceptions to write out the exception message, stack trace and form post values. You can also turn on tracing in that mode. This lets you start to get to the bottom of errors. I’ll be improving this some more over time, so you application can have useful error pages should they occur in release mode.
If you are interested in trying it out you can download it from his codeplex project.
Nikhil you never cease to amaze me and thank-you for all of you great work and sharing it with us. I’m off to play some more with Facebook - I might even get an account. =)
Also of note, Facebook has bought Parakey, the yet-to-launch “web operating system” created by Firefox co-founders Blake Ross and Joe Hewitt. The price isn’t being disclosed, but Facebook should be issuing a press release this afternoon.
Listen to this podcast
