Jul 23, 2009 at 5:40 PM
Edited Jul 23, 2009 at 5:40 PM

For some reason, when using stream.publish, it publishes as a status update not a wall post.  This is the code I am using - 

                    Dictionary<string, string> param = new Dictionary<string, string>();

                    param.Add("method", "Stream.publish");
                    param.Add("message", "Test message");


What other paramaters does this accept and how would I add them to make it work correctly? 

Jul 28, 2009 at 3:31 PM

From what I understand, if you don't want an update to publish as a status update, you have to pass in an "attachment" parameter as well. See this page for details:

That said, I don't really know these days if Facebook treats normal wall updates much differently from status updates, since they're very similar. Also, you might want to get the latest version of the FDT - it should have stream.publish already implemented for you, so you don't have to write the whole thing yourself.

Jul 28, 2009 at 4:05 PM

I cant find how to use stream.publish in the latest version.  Any help?

Jul 28, 2009 at 6:27 PM

Well I found it... But when trying to add an attachment, I get an object reference not set to instance of an object.  Any ideas -

facebook.Components.FacebookService fbService = new facebook.Components.FacebookService();
            fbService.API.ApplicationKey = "APPKEY";
            fbService.API.Secret = "SECRET";
            attachment thisAttachment = new attachment();
   = "Attachment Name";
            thisAttachment.caption = "Attachment Caption";
            thisAttachment.href =;
            thisAttachment.description = "Attachment description";
  "This is a test message", thisAttachment, null, base.API.uid.ToString(), Convert.ToInt32(base.API.uid));


Jul 28, 2009 at 7:27 PM

I assume you're using version 2.1 of the toolkit? That version has a bug in it which has been fixed in 3.0, where the "properties" of the attachment were required instead of optional. You have a few options: populate the "properties" property as needed, edit the toolkit code for 2.1 locally to fix the bug, or upgrade to 3.0 (source only available right now - official binary release coming soon).

Jul 29, 2009 at 2:44 PM

I tried with the 3.0 code and it said facebook.Components doesn't exist.  What is the exact markup I need to use to add properties?  All the intellisense says is attachment_property and I have no idea how to form that

Jul 30, 2009 at 4:08 PM
Edited Jul 30, 2009 at 4:48 PM

Duh, for future reference for people just use -

attachment attachment = new attachment();

            attachment.caption = "";
   = "I am bursting with joy";
            attachment.href = "";
            attachment.description = "a funny looking cat";
   = new attachment_property()
                category = new attachment_category()
                    href = "",
                    text = "humor"
                ratings = "5 stars"
   = new List<attachment_media>(){new attachment_media_image()
                                        src = "",
                                        href = ""

  "This is a test message", attachment, null, base.API.uid.ToString(), Convert.ToInt32(base.API.uid));
Nov 1, 2010 at 3:49 PM

hi to all

i have one clarification in this above code. It has used "fbservice". i want to know "fbservice" version and download link.. 

Please help me...