Assembly dependency error on using Google OCR- google.protobuf

1

I am trying to integrate Google OCR locally in a project with .Net Framework 4.5. But the error i am running is as below.

Error log :

System.IO.FileLoadException: Could not load file or assembly 'Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Package.config

<package id="Google.Api.CommonProtos" version="1.3.0" targetFramework="net45" 
/>
  <package id="Google.Api.Gax" version="2.4.0" targetFramework="net45" />
  <package id="Google.Api.Gax.Grpc" version="2.4.0" targetFramework="net45" 
/>
<package id="Google.Apis" version="1.34.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.34.0" targetFramework="net45" /> 
<package id="Google.Apis.Core" version="1.34.0" targetFramework="net45" />
<package id="Google.Cloud.Vision.V1" version="1.2.0" targetFramework="net45" 
/>
<package id="Google.LongRunning" version="1.0.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.6.0" targetFramework="net45" />
<package id="Grpc.Auth" version="1.12.0" targetFramework="net45" />
<package id="Grpc.Core" version="1.12.0" targetFramework="net45" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" 
version="2.0.0" targetFramework="net45" />
<package id="Microsoft.Net.Compilers" version="2.8.2" targetFramework="net45" 
developmentDependency="true" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.1.1" 
targetFramework="net45" />
<package id="System.Net.Http" version="4.3.3" targetFramework="net45" />

web.config

 <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.34.0.0" newVersion="1.34.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Google.Apis.Auth.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.34.0.0" newVersion="1.34.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.6.0.0" newVersion="3.6.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Google.Api.CommonProtos" publicKeyToken="3ec5ea7f18953e47" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Google.Api.Gax.Grpc" publicKeyToken="3ec5ea7f18953e47" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
  </dependentAssembly>
</assemblyBinding>
</runtime>

Is there any workaround when not installing through NPM? or any solution for above issue??

c#
asp.net
google-api
ocr
.net-4.5
asked on Stack Overflow Jul 5, 2018 by Prathamesh • edited Jul 5, 2018 by Prathamesh

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0