无法加载DLL“git2.dll”指定的模块找不到 [英] Unable to load DLL 'git2.dll' The specified module could not be found

查看:772
本文介绍了无法加载DLL“git2.dll”指定的模块找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Web项目使用 libgit2sharp 。问题是,libgit2sharp的解决方案是VS2010,我使用VS2008。所以我不得不创建一个新的解决方案和修改代码不使用默认参数。这不是一个问题,但我得到的标题所列的异常,当我尝试使用编译libgit2sharp DLL。

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.

我试过在git2.dll链接,但是这并没有帮助。 。复制git2.dll到web项目也毫无帮助。

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.

修改:这个问题是在LibGit2Sharp问题跟踪处理了: https://github.com/libgit2/libgit2sharp/issues/39

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

推荐答案

关闭我的头顶,我想说的是, git2.dll libgit2 库的编译版本)是不是在你的输出目录( bin\ [发布|调试]

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]).

由于 git2.dll 是没有管理依赖,你不能从你的项目中引用它。

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.

另一种选择是从您的解决方案中链接的dll文件,并更改其属性,使其复制,如果新(见下文)

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)

如果您遇到任何问题,请创建在 bug跟踪系统

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

这将是更容易跟踪; - )

It will be easier to track ;-)

更新:

为了这一跑,你必须确保编译后的文件 libgit2.dll 位于同一目录比组装 LibGit2Sharp.dll 。这样,预期的组装机库的动态加载会工作。

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.

git2.dll 的编译型C libgit2 的)应该在顶层生成的 你的输出目录( bin\ [发布|调试] )。

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

这篇关于无法加载DLL“git2.dll”指定的模块找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆