Windows runtime 写入文件元数据Windows应用商店应用

Windows runtime 写入文件元数据Windows应用商店应用,windows-runtime,windows-store-apps,metadata,Windows Runtime,Windows Store Apps,Metadata,我有以下代码: var props = App.CurrentFile.Properties.GetDocumentPropertiesAsync(); props.GetResults().Comment = "Comments goes here"; await props.GetResults().SavePropertiesAsync(); CurrentFile的类型为StorageFile。当我尝试使用SavePropertiesAsync()保存更

我有以下代码:

var props = App.CurrentFile.Properties.GetDocumentPropertiesAsync();
        props.GetResults().Comment = "Comments goes here";
        await props.GetResults().SavePropertiesAsync();
CurrentFile的类型为StorageFile。当我尝试使用SavePropertiesAsync()保存更新的注释值时,它失败,出现以下COM异常

Error HRESULT E_FAIL has been returned from a call to a COM component.
我在这个博客上举了一个非常基本的例子:

有什么想法吗

谢谢,
Jay

文件格式必须支持元数据。例如,XML文件不能有任何属性,但JPEG文件可以。

请确保等待GetDocumentPropertiesAsync调用。