Last post Jun 07, 2018 05:35 AM by Brando ZWZ
Member
235 Points
574 Posts
Jun 06, 2018 03:34 PM|mazhar khan india|LINK
Hanging Cloud Vision API using Asp.net c#,
I am getting hangs in below line.
var response = client.DetectText(image); // <-- Nothing happens, app hangs, why?
Below is my design code.
<form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> </form>
Below is my code which worte in button click for display in label
protected void Button1_Click(object sender, EventArgs e) { var image = Google.Cloud.Vision.V1.Image.FromFile(@"C:\!\cat.jpg"); var credential = GoogleCredential.FromFile(@"C:\!\Tutorials-0a2efaf1b53c.json"); var channel = new Grpc.Core.Channel(@"http://vision.googleapis.com", credential.ToChannelCredentials()); // <-- Getting error in this line var client = ImageAnnotatorClient.Create(channel); var response = client.DetectText(image); foreach (var annotation in response) { if (annotation.Description != null) // Console.WriteLine(annotation.Description); Label1.Text += annotation.Description + "\r\n"; } }
I used below example url:
Detecting content in Google Cloud Vision for .NET does nothing/hangs app
I tried below code also using console application but same response is not working is my console code.
static void Main(string[] args) { var credential = GoogleCredential.FromFile(@"C:\!\Tutorials-0a2efaf1b53c.json"); var channel = new Grpc.Core.Channel(ImageAnnotatorClient.DefaultEndpoint.ToString(), credential.ToChannelCredentials()); var client = ImageAnnotatorClient.Create(channel); var image = Google.Cloud.Vision.V1.Image.FromFile(@"C:\!\cat.jpg"); var response = client.DetectLabels(image); foreach (var annotation in response) { if (annotation.Description != null) Console.WriteLine(annotation.Description); } }
Star
9831 Points
3120 Posts
Jun 07, 2018 05:35 AM|Brando ZWZ|LINK
Hi mazhar khan india,
According to your description, this issue is realted with the goole cloud version API issue not asp.net issue.
I suggest you could post this issue on the google support forum.
https://groups.google.com/forum
Best Regards,
Brando
Member
235 Points
574 Posts
Hangs Cloud Vision API using Asp.net c# (response is not working)
Jun 06, 2018 03:34 PM|mazhar khan india|LINK
Hanging Cloud Vision API using Asp.net c#,
I am getting hangs in below line.
Below is my design code.
Below is my code which worte in button click for display in label
I used below example url:
Detecting content in Google Cloud Vision for .NET does nothing/hangs app
I tried below code also using console application but same response is not working is my console code.
Star
9831 Points
3120 Posts
Re: Hangs Cloud Vision API using Asp.net c# (response is not working)
Jun 07, 2018 05:35 AM|Brando ZWZ|LINK
Hi mazhar khan india,
According to your description, this issue is realted with the goole cloud version API issue not asp.net issue.
I suggest you could post this issue on the google support forum.
https://groups.google.com/forum
Best Regards,
Brando