title: Microsoft Cognitive Service Vision API ClientException Error
body: <p>I'm trying to use Vision Cognitive Services to receive the description of an image but my code always throws this exception:</p>
  
  <pre><code>Exception Microsoft.ProjectOxford.Vision.ClientException
  HResult=0x80131500
  Origine=&lt;Non è possibile valutare l'origine dell'eccezione&gt;
  Stack:
  in Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException (Exception exception)
  in Microsoft.ProjectOxford.Vision.VisionServiceClient.&lt;SendAsync&gt;b__42_1[TRequest,TResponse](Exception e)
  in System.AggregateException.Handle(Func`2 predicate)
  in Microsoft.ProjectOxford.Vision.VisionServiceClient.&lt;SendAsync&gt;d__42`2.MoveNext()
  in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  in Microsoft.ProjectOxford.Vision.VisionServiceClient.&lt;AnalyzeImageAsync&gt;d__21`1.MoveNext()
  in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  in Microsoft.ProjectOxford.Vision.VisionServiceClient.&lt;AnalyzeImageAsync&gt;d__20.MoveNext()
  in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  in System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
  in CognitiveServices.MainPage.&lt;Button_Clicked&gt;d__1.MoveNext() in C:\Users\manu9\documents\visual studio 2017\Projects\CognitiveServices\CognitiveServices\CognitiveServices\MainPage.xaml.cs: riga 48
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>using Microsoft.ProjectOxford.Vision;
  using Microsoft.ProjectOxford.Vision.Contract;
  using Plugin.Media;
  using System;
  using System.Collections.Generic;
  using System.Diagnostics;
  using System.IO;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using Xamarin.Forms;
  
  namespace CognitiveServices
  {
      public partial class MainPage : ContentPage
      {
          public MainPage()
          {
              InitializeComponent();
          }
  
          private async void Button_Clicked(object sender, EventArgs e)
          {
              var media = Plugin.Media.CrossMedia.Current;
              await media.Initialize();
              var file = await media.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
              {
                  SaveToAlbum = false
              });
              image.Source = ImageSource.FromStream(() =&gt; file.GetStream());
  
              var visionClient = new VisionServiceClient("MY_API_KEY");
  
              var visualFeats = new VisualFeature[]
              {
                  VisualFeature.Description, 
                  VisualFeature.Faces
              };
  
              Stream imagestream = file.GetStream();
              imagestream.Seek(0, SeekOrigin.Begin);
  
              var result = await visionClient.AnalyzeImageAsync(imagestream, visualFeats);
              description.Text = result.Description.Captions.First().Text;
  
              Debug.WriteLine(result.Description.Captions[0].Text);
              file.Dispose();
          }
      }
  }
  </code></pre>
  
  <p>Why do I have always this Exception? I read that someone resolved this by adding something like <code>imageStream.Seek(0)</code> is it true?</p>