libgit2 / libgit2/libgit2sharp
The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying create a project to cloned my repository on start. But when i try do this in setup project i receive this message:

The code is simple, but in setup project dont work.
private void Form1_Load(object sender, EventArgs e)
{
LibGit2Sharp.Repository.Clone(@"https://github.com/libgit2/libgit2sharp.git", @"C:\Users\andre\Downloads\test");
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure from the Form1_Load entry point using LibGit2Sharp.Repository.Clone in the setup project, then inspect the NativeMethods type initializer mentioned in the exception. Done means identifying the setup or runtime condition that causes the exception and documenting a reproducible fix or the missing deployment requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100