title: Create Event C# SDK Failes - Getting (OAuthException) (#324) Missing or invalid image file
body: <p>I am trying to create an event using the C# SDK. I am using the code from the following blog:</p>
  
  <p><a href="http://facebooksdk.blogspot.co.uk/2011/05/facebook-create-event.html" rel="nofollow">http://facebooksdk.blogspot.co.uk/2011/05/facebook-create-event.html</a></p>
  
  <p>And I am using an image that I copied from an existing event on Facebook. </p>
  
  <p>I am getting however the following error:</p>
  
  <p>(OAuthException) (#324) Missing or invalid image file</p>
  
  <p>Does anyone have an idea how to make it work?</p>
  
  <p>Many thanks!</p>
  
  <p>The code is as follows:</p>
  
  <pre><code> public string CreateEvent()
      {
          var fb = new FacebookWebClient();
          Dictionary&lt;string, object&gt; createEventParameters = new Dictionary&lt;string, object&gt;();
          createEventParameters.Add("name", "My birthday party )");
          createEventParameters.Add("start_time", DateTime.Now.AddDays(2).ToUniversalTime().ToString(new CultureInfo("en-US")));
          createEventParameters.Add("end_time", DateTime.Now.AddDays(2).AddHours(4).ToUniversalTime().ToString(new CultureInfo("en-US")));
          createEventParameters.Add("owner", "Balaji Birajdar");
          createEventParameters.Add("description", " ( a long description can be used here..)");
  
          //Add the "venue" details for the event
          JsonObject venueParameters = new JsonObject();
          venueParameters.Add("street", "dggdfgg");
          venueParameters.Add("city", "gdfgf");
          venueParameters.Add("state", "gfgdfgfg");
          venueParameters.Add("zip", "gfdgdfg");
          venueParameters.Add("country", "gfdgfg");
          venueParameters.Add("latitude", "100.0");
          venueParameters.Add("longitude", "100.0");
          createEventParameters.Add("venue", venueParameters);
  
          createEventParameters.Add("privacy", "OPEN");
          createEventParameters.Add("location", "fhdhdfghgh");
  
          //Add the event logo image
  
          //You can add the event logo too
          FacebookMediaObject logo = new FacebookMediaObject()
          {
              ContentType = "image/jpeg",
              FileName = @"C:\DevProjects\O2\o2PriorityFB\o2PriorityFB.Web\Images\logo.jpg"
          };
  
          logo.SetValue(System.IO.File.ReadAllBytes(logo.FileName));
          createEventParameters["@file.jpg"] = logo;
  
          JsonObject resul = fb.Post("/me/events", createEventParameters) as JsonObject;
          return resul["id"].ToString();
      }
  </code></pre>