libgit2 / libgit2/libgit2sharp

Error loading DLL git2-3f4182d on Windows (module not found)

Đang mở
#2,142 5 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm developing a Visual Studio 2022 extension that uses LibGit2Sharp to retrieve Git repository information (such as the current branch name) and to manage open documents based on the active branch. However, when running my extension on Windows, I encounter the following error:

Unable to load DLL 'git2-3f4182d': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I noticed that the LibGit2Sharp.dll.config file only contains dllmap entries for Linux and macOS, with no mapping for Windows. Despite installing the LibGit2Sharp.NativeBinaries package and verifying that the project’s platform configuration (x86 vs x64) matches the deployed binaries, the error persists.

I'm running on .net 4.7.2. The code is pretty simple since it's an R&D POC.


string testDir = "";
try
{
    using (var repo = new Repository(_repoPath))
    {
        testDir = repo.Head?.FriendlyName;
    }
}

_repoPath is not empty, and it exists as the current Git repository. (with an .git folder)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh gọi Repository trong extension Visual Studio 2022 trên .NET 4.7.2, sau đó kiểm tra LibGit2Sharp.dll.config và việc triển khai LibGit2Sharp.NativeBinaries đã cài đặt. Kiểm tra cách định vị DLL native của Windows và liệu kiến trúc đã triển khai có khớp với extension hay không; được coi là hoàn tất khi repository mở được và có thể đọc repo.Head.FriendlyName mà không gặp lỗi tải DLL.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
devtools, operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.