libgit2 / libgit2/libgit2sharp
Error loading DLL git2-3f4182d on Windows (module not found)
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo la chiamata a Repository nell’estensione Visual Studio 2022 su .NET 4.7.2, quindi esamina LibGit2Sharp.dll.config e la distribuzione installata di LibGit2Sharp.NativeBinaries. Verifica come viene individuata la DLL nativa di Windows e se l’architettura distribuita corrisponde a quella dell’estensione; il lavoro è completato quando il repository si apre e repo.Head.FriendlyName può essere letto senza l’errore di caricamento della DLL.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, git
- Ambito
- devtools, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100