prabirshrestha / FacebookSharp

Facebook Graph API for .Net
Other
30 stars 15 forks source link

asp.net 2.0 #17

Closed witiokz closed 13 years ago

witiokz commented 13 years ago

Hello, i can't understand, why this plugin doesn't work with asp.net 2.0 ? I have this error:

Error 13 'FacebookSharp.Facebook' does not contain a definition for 'PostToWall'

using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;

using FacebookSharp.Schemas.Graph; using FacebookSharp.Extensions; using Website; using FacebookSharp;

public partial class Facebook : BasePage { protected void Page_Load(object sender, EventArgs e) {

}

public void Publish()
{
    if (Session["text"] != null)
    {

        FacebookContext.FacebookContext.PostToWall(Session["text"].ToString(), null);
        //lblMessagePostStatus.Text = FacebookContext.FacebookContext.GetPost(fbMessageId).Message;
        Session["text"] = null;
    }
}

}

BasePage is in Website namespace.

prabirshrestha commented 13 years ago

PostToWall is an extensions method.

it requires to add this namespace. using FacebookSharp.Extensions;

PostToWall is not working in your case becoz of .net 2.0, you require higher version v3.0 at minimum.

prabirshrestha commented 13 years ago

incase you are using .net 3.5 or lower, make sure u reference the appropriate extensions dll

there are two extensions dlls (FacebookSharp.Extensions.dll) use the one that is compiled under .net 3.5, this mite work for 2.0

witiokz commented 13 years ago

FacebookSharp.Extensions.dll .net 3.5 version doesn't help or may help if upgrade project at least to .net 3.5, but i can't. I think, maybe i could write any web service, that could communicate with facebook, but i don't have any idea, how to do that. Thanks for fast answering.

prabirshrestha commented 13 years ago

writing your own one will take pretty long time and effort. that what libraries are for. will make ur life easier.

if you want to write simple, i suggest you to look at the official facebook c# sdk at https://github.com/facebook/csharp-sdk/blob/master/facebook/FacebookAPI.cs but then you would have to do lot of work manually. u dont get methods like PostToWall and other extension methods.

i u can i highly suggest u at least upgrade to 3.5.

witiokz commented 13 years ago

ok, thanks.