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.

libgit2sharp 0.22 is not working with LinqPad and VS 2015

See original GitHub issue

I have the latest libgit2sharp from NuGet (0.22.0) and the latest LinqPad (5.08.01). I’m getting the following exception:

DllNotFoundException: Unable to load DLL 'git2-785d8c4': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I’ve read though the discussion on #515 and added the following to my PATH, but to no avail:

%userprofile%\.nuget\packages\LibGit2Sharp.NativeBinaries\1.0.129\libgit2\windows\x86

Any advice on getting it working with LinqPad would be much appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
albaharicommented, Oct 10, 2016

Tell you what: I’ll release a LINQPad beta shortly that will use convention-based logic to detect NuGet packages with native dependencies and automatically modify the path. This will also work for other package such as System.Data.SQLite, and any package where the native DLLs are in a path containing \x86, \win-x86, \win7-x86, \x64, \amd64, \win-x64\ or \win7-x64\

0reactions
embixcommented, Feb 6, 2017

possible regression bug? (Joe Albahari’s workaround still works http://stackoverflow.com/a/39940985/303290 ) LINQPad5 v5.20.02(AnyCPU) LigGit2Sharp0.23.1

5TypeInitializationException4 
The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. 

Message
The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. 

Data

5IDictionary (1 item)4 

Key

Value

LINQPadHandled null 
 

InnerException

6DllNotFoundException4 
Unable to load DLL 'git2-a5cf255': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 

TargetSite

6RuntimeMethodInfo4 
NativeMethods.git_repository_open (git_repository*& repository, FilePath path) 

StackTrace
   at LibGit2Sharp.Core.NativeMethods.git_repository_open(git_repository*& repository, FilePath path)
   at LibGit2Sharp.Core.Proxy.git_repository_open(String path) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Core\Proxy.cs:line 2537
   at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Repository.cs:line 193
   at UserQuery
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart() 

HelpLink
null 

Source
LibGit2Sharp 

HResult
-2146233036 

TypeName
LibGit2Sharp.Core.NativeMethods 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does this code operate differently when compiled in ...
Linqpad 4 uses CSharpCodeProvider and it works there. Visual Studio uses CSC.exe and it does not work there. I have no idea how...
Read more >
Untitled
There seems to be an issue with the latest version of LibGit2Sharp (0.22.0 at time of writing) and LinqPad / Visual Studio. I...
Read more >
libhttp - OSCHINA - 中文开源技术交流社区
... to continue or ctrl-c to cancel adding it **_此处我按的是ENTER键_** gpg: ... for Ubuntu Wine Team" imported gpg: no ultimately trusted keys found...
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