Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
donk7413 opened this issue Feb 12, 2025 · 0 comments
Open

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

donk7413 opened this issue Feb 12, 2025 · 0 comments

Comments

@donk7413
Copy link

donk7413 commented Feb 12, 2025

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant