LibGit2Sharp 无法找到 git2.dll [英] LibGit2Sharp fails to find git2.dll

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

问题描述

我构建了一个小型 wpf 应用程序,用于管理我正在开发的网站.这个应用程序的主要特点是它允许我签出主题存储库的不同分支.这在 Visual Studio 中非常有效,但是当我在 Windows 8 机器上发布、安装和运行该应用程序时,它会返回:

I have built a tiny wpf app that manages a website I am working on. The key feature of this app is that it allows me to checkout different branches of a theme repository. This works perfectly in visual studio, but when I publish, install and run the app on my windows 8 machine it comes back with:

{"Unable to load DLL 'git2': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}

我已经通过互联网和 stackoverflow 进行了搜索.还有类似的问题,比如无法加载 DLL 'git2.dll' 找不到指定的模块 但提供的答案(以及答案中描述的 github 问题中显示的答案)带来了另一个错误:

I have searched through the internet and stackoverflow. There are similar questions, such as Unable to load DLL 'git2.dll' The specified module could not be found but the answers provided (as well as the answers shown in the github issue described in the answer) bring up another error:

Unable to find an entry point git_reference_oid in git2.dll

我尝试通过 nuget 安装最新版本,包括编译的 dll 并添加 git2.dll,包括我的解决方案中的 libgit2sharp 项目.再一次,当我通过 Visual Studio 运行它时它运行良好,但在我发布、安装和运行它时失败.

I have tried installing the latest through nuget, including a compiled dll and adding the git2.dll, including the libgit2sharp project in my solution. Once again, it works perfectly when I run it all through visual studio, but fails when I publish, install and run it.

我不确定需要包含哪些信息,所以请随时发表评论并告诉我,以便我可以更新问题.

I was unsure what information needed to be included so please feel free to comment and let me know so I can update the question.

谢谢!

推荐答案

您正在运行安装的可执行文件的计算机可能缺少 MSVCR100.DLL 或 MSVCR110.DLL(取决于 git2.dll 是使用 Visual Studio 2010 编译还是2012).

The computer you're running the installed executable on may lack MSVCR100.DLL or MSVCR110.DLL (depending if git2.dll has been compiled using Visual Studio 2010 or 2012).

最近在 libgit2 中合并了一个 fix消除了对这种依赖的需要.

A fix has been recently merged in libgit2 which removes the need for this dependency.

确实,针对这些二进制文件运行 dumpbin/IMPORTS git2.dll 不再显示对 MSVCR1x0.dll 的任何依赖.

Indeed, running dumpbin /IMPORTS git2.dll against those binaries doesn't show any dependency against MSVCR1x0.dll any longer.

LibGit2Sharp 项目的 vNext 分支的最新提示嵌入了那些更新的 git2.dll.建议编译项目(使用 build.libgit2sharp.cmd 工具并使用此版本(托管程序集 + 本机二进制文件)代替).

The latest tip of the vNext branch of the LibGit2Sharp project embeds those updated git2.dlls. It's recommended to compile the project (using the build.libgit2sharp.cmd tool and use this version (manged assembly + native binaries) instead).

这篇关于LibGit2Sharp 无法找到 git2.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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