libgit2sharp
libgit2sharp copied to clipboard
TypeInitializationException - unable to load shared library git2-106a5f2
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
Same for me, but on Windows 11, and it works intermittently. I'm using that in the vsix package for visual studio.
I also managed to get this reproduced on macOS.
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?