内のファイルは、私はいくつかの問題がある場合:一部例外私はWinRTの中</p> <p>質問1ファイルにアクセスする際のアクセスWinRTの
var file = await StorageFile.GetFileFromPathAsync(filePath);
を時々GetFileFromPathAsyncは、「RPCサーバーを利用できません」例外がスローされます。
質問2:
MusicProperties musicProp = await file.Properties.GetMusicPropertiesAsync();
時にはそれが例外をスローします:
Unable to cast COM object of type 'Windows.Storage.FileProperties.MusicProperties' to interface type 'Windows.Storage.FileProperties.IMusicProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BC8AAB62-66EC-419A-BC5D-CA65A4CB46DA}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
は質問3:
Unable to cast COM object of type 'Windows.Storage.StorageFile' to interface type 'Windows.Storage.IStorageFile'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{C7034384-F12E-457A-89DA-69A5F8186D1C}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
:
QueryOptions query = new QueryOptions(CommonFileQuery.OrderByMusicInfo, extensionList);
StorageFileQueryResult queryResult = folder.CreateFileQueryWithOptions(query);
IReadOnlyList<IStorageFile> files = await queryResult.GetFilesAsync();
時にはそれが例外をスローします
これらの例外は常にスローされることはありませんが、ときどきスローされます。どうして?