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

Open
#2,005 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, git
Domain
desktop

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.

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:


image

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");
		}

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libgit2/libgit2sharp

All issues in libgit2/libgit2sharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.