libgit2 / libgit2/libgit2sharp
Error loading DLL git2-3f4182d on Windows (module not found)
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- C#
- Estrelas
- 3.5k
- Forks
- 925
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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)
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece reproduzindo a chamada a Repository na extensão do Visual Studio 2022 em .NET 4.7.2; depois, inspecione LibGit2Sharp.dll.config e a implantação instalada de LibGit2Sharp.NativeBinaries. Verifique como a DLL nativa do Windows é localizada e se a arquitetura implantada corresponde à da extensão; considera-se concluído quando o repositório é aberto e repo.Head.FriendlyName pode ser lido sem o erro de carregamento da DLL.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, git
- Domínio
- devtools, operating-systems
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100