Share via

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
Microsoft 365 and Office | Development | Other
Azure Language in Foundry Tools
Azure Language in Foundry Tools

An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.

Developer technologies | .NET | Other
Developer technologies | C#
Developer technologies | 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.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.