开发者

Setup of Facebook-C#-SDK in Visual Studio and Facebook

i'm using http://facebooksdk.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Documentation

CAn I used localhost and the visualstudio 2010 websever for debug? Why is this stuff so hard?

I've basically downloaded the sample and I'm trying to CSASPNETFacebookApp web project to work. I keep getting redirected to a link like this:

Server Error in '/CSASPNETFacebookApp' Application.

The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.开发者_如何学JAVA Please review the following URL and make sure that it is spelled correctly.

Requested URL: /CSASPNETFacebookApp/facebookredirect.axd/CSASPNETFacebookApp/default.aspx

Thanks for enter code hereyour time:

my config looks like this:

<httpHandlers>

  <add verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" />
</httpHandlers>

  <add name="facebookredirect" path="facebookredirect.axd" verb="*" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" />

</handlers>


The built-in Visual Studio web server (Cassini) doesn't work with WebForms apps. Check out the discussion at http://facebooksdk.codeplex.com/Thread/View.aspx?ThreadId=237454

There are basically 3 ways around this problem:

  1. use a local IIS server for debugging. To get it to work under IIS7 you must remove the entire httpHandlers section from your web.config
  2. modify the SDK's source code not to rely on facebookredirect.axd for redirection (that's what I did). Basically hack Facebook.Web.CanvasUrlBuilder.BuildAuthReturnUrl to build the final URL for redirection. This solution may break some other stuff, since I'm not sure that the hell was the rationale for using facebookredirect.axd and not something simpler.
  3. check out any other solutions proposed in the above forum thread.

Good luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜