libgit2 / libgit2/libgit2sharp

The entry point "git_libgit2_init" was not found in the DLL "git2-a418d9d"

未关闭
#2,126 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C#
星标
3.5k
派生
925
PR 合并指标
30 天内没有已合并 PR

描述

Hi,

I try to use LibGit2Sharp within my .NetFw 4.8 Project and stuck with an error when trying to use the lib.

It seems to not be able to load/read from the NativeLibaries file correctly.

Reproduction steps:

Add nuget-Packages to your project:

<package id="LibGit2Sharp" version="0.30.0" />
<package id="LibGit2Sharp.NativeBinaries" version="2.0.322" />

Build will create files in the output directory as expected "/lib/win32/x64/git2-a418d9d.dll"

Call Any Method. For example: Repository.Clone(pullurl, workingdir);

Expected behavior:

Execute of "clone" command sucessfully finished.

Actual behavior:

The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.

The Stacktrace:
Unexpected exception occurred: System.TypeInitializationException: The type initializer for "LibGit2Sharp.Core.NativeMethods" threw an exception. ---> System.EntryPointNotFoundException: The entry point "git_libgit2_init" was not found in the DLL "git2-a418d9d". at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()...

Version of LibGit2Sharp
0.30.0

Version of NativeBinaries
2.0.322

OS: Windows 10 based
.NetFW: 4.8 C#7 (SDK 6 & 8 installed)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在装有 .NET Framework 4.8 的 Windows 10 上使用 LibGit2Sharp 0.30.0 和 NativeBinaries 2.0.322 重现该故障。跟踪 LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary,并检查位于 lib/win32/x64/git2-a418d9d.dll 的原生 DLL,重点关注缺失的 git_libgit2_init 入口点。当 Repository.Clone 能够成功执行且不再出现 TypeInitializationException 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, git
领域
operating-systems, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
32/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。