I gave up on this approach and instead used office.js. I had no problems calling the services from there.
Getting a 10054 error when calling a Cognitive Services API from VSTO Word Add-in
AdamMorgan-1941
15
Reputation points
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