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 . 

  • 相关阅读:
    nginx 配置以及常用命令
    django TypeError: 'module' object is not callable
    Django Meta内部类选项
    安装MySQL后要做的事
    MySQL存储引擎
    kali linux 2018.2 mysql密码修改后无效,外部无法连接问题。
    Django中CSS加载background url('')问题
    升级OPENSSH 和 OPENSSL
    Git创建仓库的方法(github翻译)
    Git标签(版本)管理
  • 原文地址:https://www.cnblogs.com/MysticBoy/p/12302094.html
Copyright © 2011-2022 走看看