1

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

I'm having trouble with adding content.

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/

Community
  • 1
  • 1
Tayfun Yaşar
  • 422
  • 2
  • 9
  • 24

1 Answers1

0

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.

William Price
  • 4,033
  • 1
  • 35
  • 54
chobi
  • 1