cancel
Showing results for 
Search instead for 
Did you mean: 

Google Vision API - Custom code

Anonymous
Not applicable
Hi, I am trying to extract the text from the image using google vision API. The same code with the required references is working in visual studio but not in blueprism.

"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)". This is the error while I am getting.

Below are the things I tried to figure out this error but of no use.

1) Currently I am referring the Google.APIs.Auth version 1.40.2 but I tried replacing with the Google.Apis.Auth, Version=1.35.1.0. Error still appeared.
2) I removed all the dll's relevant to Google vision API except Google.Cloud.Vision, Google.Api.Gax.Grpc and Google.Protobuf.dll from the initialize page as well as from the folder "C:\Program Files\Blue Prism Limited\Blue Prism Automate". With the above dll's I am not getting any errors in building the code stage. But then when running this code again I am getting the same error as mentioned above.
3) I checked my entire system to see whether I am having the Google.APis.Auth 1.35.1.0 version specific but there is none!
4) I guess it might be a dependency version conflict. I tried to add assembly binding as we do in visual studio - app.config file or web.config file, something like below but I am not sure what is the relevant file I should refer in BP. My BP VERSION is 6.5

<runtime>     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">       <dependentAssembly>         <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral"/>         <bindingRedirect oldVersion="0.0.0.0-1.40.2.0" newVersion="1.40.2.0"/>       </dependentAssembly>     </assemblyBinding>   </runtime>
Please help me to resolve this issue!!
5 REPLIES 5

ewilson
Staff
Staff
Are you programming the Google Vision API directly yourself, or are you using an implementation from the Digital Exchange? I don't think what's available on the DX has any Google DLL's linked in it.

Cheers,
Eric

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Anonymous
Not applicable
I am programming myself. That's why I need to integrate dll.

Ok. Have you considered using the REST API instead of the .NET client SDK? The only reason I bring that is that most of the integrations I've seen people build between Blue Prism and Google tend to use the REST interfaces.

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Anonymous
Not applicable
I will check it out. But as per my knowledge I don't think google vision API have the rest API service interface. I just found the code snippets to extract the data. Can you share me the procedure/link on how to proceed further?

Yes, there is a REST API for Google's Vision service on GCP. There are two different implementations of this REST API already available on the Digital Exchange:

https://digitalexchange.blueprism.com/dx/entry/3439/solution/google-vision

https://digitalexchange.blueprism.com/dx/entry/9648/solution/cloud-vision-api-v1-2

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------