-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPF sample builds and runs but throws exception on Analyze #19
Comments
I am on the same boat. It throws an exception on every feature. When I tried OCR, it says my key is not valid but I am literally copying and pasting from the Microsoft website... the key is indeed valid. |
The error is somewhere on the api key. Despite being given an official key from Microsoft, the request doesn't accept it. I get a 401 error. |
Are either of you using the 'Try Free' API key? If so, you must use the VisionServiceClient.ctor override, and provide the host address (2nd arg) of |
Aligning the region my keys were for with the region being called fixed the problem for me. Since the region being called is buried in the code, I'd suggest making that a prompt along with the key, or somehow make it clear that the code has a specific region buried in the code that they will need to change if their keys are from a different region. |
Thanks @briannoyes This was a recent change, and we haven't yet updated the sample apps to support the region specificity, its on our backlog and we'll update the apps to prompt for a region in the future. |
I haven't had the time to try it, but does this solve the issue? Worth a try |
yep, looks like that will help |
Here is what gets dumped in the console:
[16:11:51.353827]: VisionServiceClient is created
[16:11:51.355825]: Calling VisionServiceClient.AnalyzeImageAsync()...
[16:11:53.596602]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func
2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__42
2.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__21
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()at VisionAPI_WPF_Samples.AnalyzePage.d__1.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 86
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 141
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90
The text was updated successfully, but these errors were encountered: