Post into wordpress blog via C# & WordPressSharp

I’m using WordPressSharp and trying to add content into my wordpress blog.

I’m having trouble with adding content.

Read More
Helper.WordpressConfigurations.postToWordpress(1, "testing", "content description");

Here is my post method

public static Post setPost(int postType, string title, string content)
    {
      string type = postType == 1 ? "post" : "page";
      int categoryId = 0;
      switch ("".ToLowerInvariant())
      {
        case "arrow": categoryId = 4; break;
        default: categoryId = 0; break;
      }
      return new Post
      {
        PostType = "post", // "post" or "page"
        Title = title,
        Content = content,
        PublishDateTime = DateTime.Now,
        Status = "publish"//, // "draft" or "publish",
        //Terms = terms
      };
    }

Having exception in WordPressClient.cs >

enter image description here

my full code here http://paste.ubuntu.com/10793675/

Related posts

Leave a Reply

1 comment

  1. WordPressSharp depends on xml-rpc.net version 3.0.0, which is not yet a stable version and seems to have bugs. Try using version 2.5.0 instead.

    1. Download source of wordpresssharp and xml-rcp.net 2.5.0.
    2. Delete the reference to the assembly of 3.0.0 from the wordpresssharp project and add a reference to 2.5.0 instead.

    It worked in my case, and I hope it’ll be of help to you.