title: "A generic error occurred in GDI+" when attempting to use Image.Save
body: <p>I am developing an Outlook 2010 Add-In, and am loading an image from a serialized XML file.  The image loads fine, and am able to assign it to a pictureBox object on a Winform no problem.  The object is saved in </p>
  
  <pre><code>[XmlIgnore]
  public Bitmap Image
  {
     get { return this.templateImage; }
     set { this.templateImage = value; }
   }
  </code></pre>
  
  <p>When, I attempt to save the physical file onto the harddisk however, I am doing:</p>
  
  <pre><code>string filePath = Path.Combine(dirPath, item.Id + ".jpg");
  try
  {
      item.Image.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
  }
  catch (Exception e)
  {
      Debug.WriteLine("DEBUG::LoadImages()::Error attempting to create image::" + e.Message);
  }
  </code></pre>
  
  <p>and am getting an A generic error occurred in GDI+.  I've checked the write permissions on the folder, and it does have write permissions.  I'm unsure what is wrong here.  I've also changed the ImageFormat to bmp and png and so forth to see if it was a conversion problem... but it isn't.  Would anybody suggest something to try?</p>