简体   繁体   English

来自Codeplex的Facebook C#SDK集成

[英]facebook c# sdk integration from codeplex

I am using c# sdk facebook integration from codeplex and getting a strange error: 我正在从Codeplex使用C#sdk facebook集成,并收到一个奇怪的错误:

I have the following in my web.config and get an error that it does not recognize 我的web.config中包含以下内容,并收到无法识别的错误

Compile Error: 编译错误:

Warning 12 C:\\Documents and Settings\\admin\\Desktop\\car\\Phase_2\\tissot\\tissot4\\Default.aspx: ASP.NET runtime error: Unrecognized configuration section facebook. 警告12 C:\\ Documents and Settings \\ admin \\ Desktop \\ car \\ Phase_2 \\ tissot \\ tissot4 \\ Default.aspx:ASP.NET运行时错误:无法识别的配置节facebook。 (C:\\Documents and Settings\\admin\\Desktop\\car\\Phase_2\\tissot\\tissot4\\web.config line 17) C:\\Documents and Settings\\admin\\Desktop\\car\\Phase_2\\tissot\\tissot4\\Default.aspx 1 1 tissot4 (C:\\ Documents and Settings \\ admin \\ Desktop \\ car \\ Phase_2 \\ tissot \\ tissot4 \\ web.config第17行)C:\\ Documents and Settings \\ admin \\ Desktop \\ car \\ Phase_2 \\ tissot \\ tissot4 \\ Default.aspx 1 1 tissot4

<facebookSettings
appSecret="################"
appId="$$$$$$$$$$$$$$$$$" 
/>

<canvasSettings
canvasPageUrl=http://apps.facebook.com/myapp/
authorizeCancelUrl=http://apps.facebook.com/myapp/ 
/>

Have you defined the configSections ? 您定义了configSections吗?

Since Configuration Section Tags not defined is a Microsoft Bug which can be resolved by adding the configuration section tag after the section like this 由于未定义的配置节标记是Microsoft Bug ,可以通过在该节之后添加配置节标记来解决

<configSections>
    <section name="facebookSettings" type="Facebook.FacebookConfigurationSection"/>
    <section name="canvasSettings" type="Facebook.Web.CanvasConfigurationSettings"/>
  </configSections>

  <facebookSettings
        appSecret="your_api_secret" 
        appId="your_app_id" />
  <canvasSettings
    canvasPageUrl="http://apps.facebook.com/graphtoolkit/"
    authorizeCancelUrl="http://apps.facebook.com/graphtoolkit/home/cancel" />

According to the documentation here the canvasSettings element should contain the following: 根据此处的文档, canvasSettings元素应包含以下内容:

  • canvasPage
  • authorizeCancelUrl

You have canvasPageUrl where as you should be using canvasPage 您具有canvasPageUrl ,应在其中使用canvasPage

From the article mentioned above: 从上面提到的文章:

Now, right below that tag you should see the “canvasSettings” settings element. 现在,在该标签的正下方,您应该看到“ canvasSettings”设置元素。 Change it as follows (again use the Facebook screen to help you): 进行如下更改(再次使用Facebook屏幕为您提供帮助):

  • canvasPage – Canvas Page canvasPage –画布页面
  • authorizeCancelUrl – “http://www.facebook.com “(or any URL you want it to go to when Authorization fails) authorizeCancelUrl –“ http://www.facebook.com”(或授权失败时您要转到的任何URL)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM