English 中文(简体)
Unable to load DLL git2.dll The specified module could not be found
原标题:

I m trying to use libgit2sharp in a web-project. The problem is that libgit2sharp s solution is for VS2010 and I m using VS2008. So I had to create a new solution and modify the code not to use default parameters. That wasn t a problem, except I m getting the exception listed in the title when I try to use the compiled libgit2sharp DLL.

I ve tried linking in the git2.dll, but that hasn t helped. Copying the git2.dll into the web-project hasn t helped either.

Edit: The issue was handled over at the LibGit2Sharp issue tracker: https://github.com/libgit2/libgit2sharp/issues/39

最佳回答

Off the top of my head, I d say that the git2.dll (compiled version of C libgit2 library) is not in your output directory (bin[Release|Debug]).

As git2.dll is not a managed dependency, you cannot reference it from your project.

However, thanks to a prebuild event, you should be able to copy the binary to your output directory.

Another option would be to link to the dll file from within your solution and change its properties to make it copied if newer (see below)

enter image description here

Should you encounter any problem, please create an issue in the bug tracker.

It will be easier to track ;-)

UPDATE:

In order for this to run, you have to make sure that after compilation, the file libgit2.dll is located in the same directory than the assembly LibGit2Sharp.dll. This way, the dynamic loading of the native library by the assembly will work as expected.

The git2.dll (compiled version of C libgit2 library) should be generated at the top level of your output directory (bin[Release|Debug]).

More thorough information can be found in the ticket

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签