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 Winfo
I too faced same error for code line:
wmImg.Save(BrandImgPath,ImageFormat.Png);
BrandImgPath = "D:/XYZ/fileName;
Found cause:
XYZ folder didn't exist in D: drive. So my code was creating this folder later. One should ensure if that path exist or not.
if (Directory.Exists(@"D:/XYZ")) return;
Hope it will help someone to solve his code mistakes.