• 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 . 

  • 相关阅读:
    小程序开发点滴积累
    使用openssl在windows 10下本地xampp配置https开发环境
    linux networking
    CGI,FastCGI,PHP-FPM,PHP-CLI,modPHP
    centos 7.2 64位 docker安装lamp环境
    反模拟类游戏外挂 转
    鼠标 hook 源码 C#版
    C# 鼠标连击源码 转
    win32 API 在win10 64位失效
    利用浏览器外部协议(URL Procotol)打开本地exe文件
  • 原文地址:https://www.cnblogs.com/MysticBoy/p/12302094.html
Copyright © 2020-2023  润新知