zoukankan      html  css  js  c++  java
  • LibGit2Sharp在 Asp.Net Core 3.1 docker 镜像中中无法使用的问题

    The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory

    搜索了很多, 看起来全地球大家都遇到了, 然后大家都解决了, 然后就我没解决, 

    比如:加入   <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

    或者加入

    <PrivateAssets>all</PrivateAssets>
    <IncludeAssets>runtime; build; native; </IncludeAssets>

    把 linux-x64 下的  libgit2-106a5f2.so 拷贝到 程序目录  lib目录等, 都没有用。  

    常识了各种方法, 问题依旧, 

    折磨了一个小时后, 突然想到一个命令, ldd  , 于是在容器中执行了一下 ldd  libgit2-106a5f2.so 

     发现俩not  found , 看起来库不对劲。,最后查看容器的对应库版本是 1.1.0 ,查看了 libgit2sharp.nativebinaries2.0.306 untimes 下面  所有libgit2 的库 ldd 信息, 发现debian 9 是正确符合这个版本,

    最后发现是由于项目的  RuntimeIdentifier 不设置默认是linux-64 ,然后项目加入  <RuntimeIdentifier>debian.9-x64</RuntimeIdentifier> 后, "libgit2sharp.nativebinaries2.0.306 untimesdebian.9-x64 ativelibgit2-106a5f2.so" 文件使用的是 libssl.so.1.1.1 的版本   然后程序镜像重新打包重新运行, 一切OK . 

  • 相关阅读:
    【hihocoder1255 Mysterious Antiques in Sackler Museum】构造 枚举
    【hihocoder 1257 Snake Carpet】构造
    【HDU 5572 An Easy Physics Problem】计算几何基础
    【hihocoder 1258 Osu! Master】
    Coder-Strike 2014
    [不完全动态凸包]SGU277
    [成都七中]GCD
    [某模拟赛]鸡腿の乒乓
    [TCSRM518Div1]Nim
    BZOJ3289【莫队算法+树状数组+离散化】
  • 原文地址:https://www.cnblogs.com/MysticBoy/p/12302094.html
Copyright © 2011-2022 走看看