Getting a 10054 error when calling a Cognitive Services API from VSTO Word Add-in

AdamMorgan-1941 15 Reputation points
2024-05-15T21:16:54.8833333+00:00

I am developing a Word VSTO add-in so that I can call a Cognitive Services knowledgebase service. The code is pretty straight-forward and works fine when I run it from a windows console app (a similar call in python also works without issue):

Debug.WriteLine("beginning of the try");
 string azureEndpoint = "https://redacted.cognitiveservices.azure.com/"; // Replace with your actual endpoint URL
 string subscriptionKey = "redacted"; // Replace with your actual subscription key

 Uri endpoint = new Uri(azureEndpoint);
 AzureKeyCredential credential = new AzureKeyCredential(subscriptionKey);

 QuestionAnsweringClient client = new QuestionAnsweringClient(endpoint, credential);

 string projectName = "redacted";
 string deploymentName = "production";
 QuestionAnsweringProject project = new QuestionAnsweringProject(projectName, deploymentName);
 Response
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,502 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,450 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,624 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
372 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,487 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AdamMorgan-1941 15 Reputation points
    2024-05-30T16:26:33.41+00:00

    I gave up on this approach and instead used office.js. I had no problems calling the services from there.

    1 person found this answer helpful.
    0 comments No comments