Closed compvishal closed 4 years ago
@compvishal Thanks for the question. If you are building a windows app you can try to use our intelligent kiosk app as a sample to replicate reading the local file for any of our cognitive services API. Here is the link to the intelligent kiosk repo. You can try to read the file as implemented in our ImagePickerControl class.
Hi @RohitMungi-MSFT, thanks for reply. The sample code is of Universal Windows Platform Development. I am trying it. However wont the Microsoft.Azure.CognitiveServices.Vision.ComputerVision run on simple windows app on dot.net framework?
@compvishal The usage of the package is only dependent on the dependencies as listed in the nuget page:
.NETFramework 4.5.2 Microsoft.Rest.ClientRuntime (>= 2.3.18 && < 3.0.0) Microsoft.Rest.ClientRuntime.Azure (>= 3.3.18 && < 4.0.0) Newtonsoft.Json (>= 6.0.8)
.NETStandard 1.4 Microsoft.Rest.ClientRuntime (>= 2.3.18 && < 3.0.0) Microsoft.Rest.ClientRuntime.Azure (>= 3.3.18 && < 4.0.0) NETStandard.Library (>= 1.6.1) Newtonsoft.Json (>= 10.0.3) System.Net.Http (>= 4.3.0)
Thanks. Then my original question remains. Why is it not working on dot.net framework? Further the kiosk sample is giving it's own errors. Pl check the attached screenshot.
@compvishal You can publish your solution on github and reference it with an issue on our SDK repo. This forum is primarily for issues related to this document and quickstart's published by the content authors/document writers.
I am sorry if bit confused. The image is error showing in 'this document', i.e. Kiosk app only.
The sample worked out of the box without any errors.
I think you might need to resolve the missing references.
We will now proceed to close this thread as the quickstart document works fine. If there are further questions regarding this matter, please tag @RohitMungi-MSFT in your reply.
I am a Dot.Net programmer. The function runs when try it on console app (tried both C# & VB), however when trying to run it on windows app get errors. Basically I want to return value after calling an azure service, and use it in windows app.
Tried below:
Check the below code. The line marked in bold gives error. There is no message, simply the computer doesn't do anything. As 'wait' is used while calling the module "ReadFileLocal(client, READ_TEXT_LOCAL_IMAGE).Wait()",
the thread is processed asynchronously with no response
Public Sub Main() Dim client As ComputerVisionClient = Authenticate(endpoint, subscriptionKey) ReadFileLocal(client, READ_TEXT_LOCAL_IMAGE).Wait() End Sub
Public Async Function ReadFileLocal(ByVal client As ComputerVisionClient, ByVal localFile As String) As Task Text1Message = "READ FILE FROM LOCAL" ' ######## the below line is where the computer gets stuck when calling from windows project Dim textHeaders = Await client.ReadInStreamAsync(File.OpenRead(localFile), language:="en") Dim operationLocation As String = textHeaders.OperationLocation Thread.Sleep(2000) Const numberOfCharsInOperationId As Integer = 36 Dim operationId As String = operationLocation.Substring(operationLocation.Length - numberOfCharsInOperationId) Dim results As ReadOperationResult
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.