You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a new LinqPad query, add the LibGit2Sharp NuGet package, and try to perform any operation using the Repository class, such as a simple check with Repository.IsValid().
Output True or False depending if C:\Temp is a valid Git repo.
Actual behavior
Exception thrown:
The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
Unable to load DLL 'git2-572e4d8': The specified module could not be found. (Exception from HRESULT: 0x8007007E | Unable to load DLL 'git2-572e4d8': The specified module could not be found. (Exception from HRESULT: 0x8007007E
@caioproiete The reason you're seeing that is that #1563 changed the behavior around how we find the native binary. We used to modify the PATH environment variable, but now we no longer do that. I believe LINQPad currently modifies the PATH to get native binaries loaded correctly, so that no longer works for LibGit2Sharp.
There is a GlobalSettings.NativeLibraryPath API that you could call to manually set the path to the native binary, but that API currently appends x86 or x64 to whatever is specified, so that doesn't work right now either.
I think we could make some changes here to allow you to pass in the path to LINQPad's on-disk copy of the binary, but in the mean time, you're going to need to stick with 0.25.4 if you want to use it from LINQPad.
Uh oh!
There was an error while loading. Please reload this page.
Reproduction steps
On a new LinqPad query, add the
LibGit2Sharp
NuGet package, and try to perform any operation using theRepository
class, such as a simple check withRepository.IsValid()
.e.g.
Expected behavior
Output
True
orFalse
depending ifC:\Temp
is a valid Git repo.Actual behavior
Exception thrown:
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
/cc @albahari
The text was updated successfully, but these errors were encountered: