System.ArgumentException: Property is not supported exception when calling image.SetPropertyItem under Linux RRS feed

  • Question

  • I wrote a C# program targeting the .NET Core framework using Visual Studio 2019.  Under Windows, the program works fine.  I deployed the app by publishing the app as a self-contained app targeting the linux-64 runtime and then copying the files to the Debian box.

    Under Debian 10, I'm getting an exception when I make a call to the image.SetPropertyItem method.  The exception message is "System.ArgumentException: Property is not supported."

    Is it true that the SetPropertyItem is indeed not supported?  And if so, does anyone have any suggestions how else I can go about setting EXIF tags under Linux?


    Monday, October 7, 2019 3:18 PM

All replies

  • Hi RichardR, 

    Thank you for posting here.

    I note that image.SetPropertyItem(PropertyItem) method apply to .NET Core 2.1, 2.2 and 3.0, so make sure your .NET Core version is 2.1 or higher versions.

    Besides, as Microsoft document’s remarks suggested, try to obtain a PropertyItem by retrieving the PropertyItems property value or calling the GetPropertyItem method of an Image that already has property items. Then you can set the fields of the PropertyItem and pass it to SetPropertyItem.

    Hope it can help you.

    Best Regards,

    Xingyu Zhao

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 8, 2019 7:10 AM
  • Read the documentation:



    The image format of this image does not support property items.


    Check the image type you loaded into Image object at that time.

    Tuesday, October 8, 2019 9:40 AM