libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

TypeInitializationException - unable to load shared library git2-106a5f2

Open Miepee opened this issue 2 years ago • 3 comments

Reproduction steps

Repository repo = new Repository();

Expected behavior

Program should not crash

Actual behavior

Program crashes with the following text:

An exception of type 'System.TypeInitializationException' occured in LibGit2Sharp.dll but was not handled in user code: 'The type initializer for 'LibGit2Sharp.Core.Nativemethods' threw an exception.'
libgit2-106a5f2: cannot open shared object file: No such file or directory
at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
at LibGit2Sharp.Core.NativeMethods..cctor()

Version of LibGit2Sharp (release number or SHA1)

  • 0.26.2
  • 0.27.0-preview-0182

Operating system(s) tested; .NET runtime tested

  • OS: Linux Mint
  • Kernel: 5.15.0-41
  • .NET SDK / runtime: 6.0.110

Miepee avatar Oct 28 '22 20:10 Miepee

Same for me, but on Windows 11, and it works intermittently. I'm using that in the vsix package for visual studio.

kboom avatar Jan 12 '23 21:01 kboom

I also managed to get this reproduced on macOS.

Miepee avatar Jan 30 '23 23:01 Miepee

Same for me, but on Windows 11, and it works intermittently. I'm using that in the vsix package for visual studio.

Have you managed to use libgit2sharp inside a visual studio extension project?

luislhg avatar Jun 10 '24 16:06 luislhg