2017-03-17 1 views
0

私は、次のエラーを取得しています:明示的な変換が存在します。あなたはキャストを逃していますか?

An explicit conversion exists. Are you missing a cast? 

これはなぜでしょうか?

an explicit conversion exists

private async void getEmotion_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) 
     { 
      try 
      { 
       emotionResult = await emotionServiceClient.RecognizeAsync(imageStream.AsStream()); 
       if(emotionResult != null) 
       { 
        Scores score = emotionResult[0].Scores; 
       } 
      } 
      catch 
      { 
       Output.Text = "Error returning the Emotion"; 
      } 
     } 

答えて

0

同様の質問を参照してください、ここで答え:Cannot implicitly convert type 'Microsoft.ProjectOxford.Common.Contract.EmotionScores[]' to 'Microsoft.ProjectOxford.Emotion.Contract.Scores[]'

スコアとEmotionScoresを同じオブジェクト名ワイズが、自動的に変換することができないではありません。あなたはどちらか

EmotionScores scores = emotionResult[0].Scores; 

または単に

var scores = emotionResult[0].Scores; 
を言うことができます
関連する問題

 関連する問題