使用Google OCR的程序集相关性错误-google.protobuf

时间:2018-07-05 10:31:41

标签: c# asp.net google-api ocr .net-4.5

我正在尝试将一个项目中的Google OCR本地集成到.Net Framework 4.5中。但是我正在运行的错误如下。

错误日志:

  

System.IO.FileLoadException:无法加载文件或程序集“ Google.Protobuf,Version = 3.5.1.0,Culture = neutral,PublicKeyToken = a7d26565bac4d604”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (来自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>

不通过NPM安装时是否有任何解决方法?或上述问题的任何解决方案?

0 个答案:

没有答案