3

我完全不知所措。当我打电话时:

var a = VoiceCommandDefinitionManager.InstalledCommandDefinitions;

或者

await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager
    .InstallCommandDefinitionsFromStorageFileAsync( storageFile );

线程的执行在任一调用内结束。

例如,在调用 InstallCommandDefinitionsFromStorageFilesAsync 之后的以下方法中,没有任何反应。没有例外,没有写行,调用该方法后没有执行。

private async void RegisterVoiceCommands()
{
    var storageFile =
        await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync( new Uri( "ms-appx:///VoiceCommandDefinition.xml" ) );
    try
    {
        await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync( storageFile );

        Debug.WriteLine( "Voice Commands Registered" );
    }
    catch ( Exception ex )
    {
        Debug.WriteLine( ex );
    }
}

有没有人有任何想法?这曾经在技术预览版中工作。

环境:Win 10 Enterprise VS2015 Enterprise

4

1 回答 1

0

所以在我的情况下,这是一个机器问题。该项目在我尝试过的所有其他盒子上都能正常工作。我猜安装不好。

于 2015-08-06T04:20:47.940 回答