question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load DLL 'git2-106a5f2'

See original GitHub issue

Reproduction steps

  1. Open .NET Framework 4.6 project
  2. Install LibGit2Sharp.NativeBinaries v2.0.312 NuGet package.
  3. Install LibGit2Sharp v0.26.2 NuGet Package.
  4. In a .cs file, insert Repository repo = new Repository();

Expected behavior

Works.

Actual behavior

System.TypeInitializationException Message=The type initializer for ‘LibGit2Sharp.Core.NativeMethods’ threw an exception. Inner Exception 1: DllNotFoundException: Unable to load DLL ‘git2-106a5f2’: The specified module could not be found.

Version of LibGit2Sharp (release number or SHA1)

v0.26.2

Operating system(s) tested; .NET runtime tested

Windows 10, .NET Framework 4.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bordingcommented, Apr 13, 2020

@jjhayworth LibGit2Sharp requires specific versions of the LibGit2Sharp.NativeBinaries package, which is why its shipped with the package version locked.

The 0.26.2 package requires you to use LibGit2Sharp.NativeBinaries 2.0.306 only. You should be getting a warning or error in your project to even have a newer version installed.

0reactions
NPatchcommented, Nov 17, 2021

@jjhayworth I have

<package id="LibGit2Sharp" version="0.26.2" targetFramework="net472" />
 <package id="LibGit2Sharp.NativeBinaries" version="2.0.306" targetFramework="net472" />'

but still same issue Unable to load DLL 'git2-106a5f2': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Hi, Did you ever manage to fix this? I have been having the same problem but have not been able to find a way to solve it.

If this only happens with release and when you try to run the exe elsewhere, check that the lib folder is beside it. lib contains the various versions of git2 dll.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load DLL 'git2-106a5f2' - Stack Overflow
The native DLL is part of the LibGit2Sharp.NativeBinaries project that LibGit2Sharp takes a dependency on. It should be installed (transitively) ...
Read more >
Exception "Unable to load DLL 'git2-381caf5" while using ...
LibGit2Sharp 0.23.0 is marked as having dependency toward LibGit2Sharp.NativeBinaries (= 1.0.163) While updating Git Diff Margin to ...
Read more >
How to Fix Unable to Load DLL/Error ...
About the Unable to Load DLL Error; Method 1: Reinstall the Program; Method 2: Disable the Auto-Startup of the Program; Method 3: Clean...
Read more >
[Solved] Unable to Load .dll file
Hi all, I am trying to use libzplay.dll in my project but I got an error message when add Reference to this dll...
Read more >
'Unable to load DLL 'UnManaged.dll': The specified module ...
I am developing a Visual C# Desktop Application in Visual Studio 2017. I have a third party unmanaged DLL which I have to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found