我正在尝试在Blue Prism中添加Google Vision API的功能,但是出现了错误。报错信息如下:“Internal: Could not execute code stage because an exception is thrown by code stage: Could not load file or assembly 'Google.Apis.Auth, Version = 1.35.1.0, Culture = neutral, PublicKeyToken = 4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)”。但是,该dll文件位于Blue Prism文件夹中,并且我已在初始化页面中添加了引用。当前版本的Google.Apis.Auth为1.40.2,但我尝试了版本1.35.1.0,仍然无效。我尝试添加“Google.Cloud.PubSub.V1”引用,如其他线程所述,但也无法解决此问题。下面的代码与此处提到的dll引用在Visual Studio中工作正常,但在Blue Prism中不起作用。请有人帮助我解决这个问题。
var image = Image.FromFile("C:/New folder/Google VisionAI/otter_crossing.jpg");
var client = ImageAnnotatorClient.Create();
var response = client.DetectText(image);
foreach (var annotation in response)
{
if (annotation.Description != null)
{
Output = annotation.Description;
}
}