Skip to content

At runtime: “The type initializer for ‘LibGit2Sharp.Core.NativeMethods’ threw an exception #1573

@verxion

Description

@verxion

Reproduction steps

Run “Package-Install LibGit2Sharp” once in a solution with only one project and once in a solution with multiple projects. Using “LibGit2Sharp.Repository.Clone” works fine from the single project solution, but fails in the multiproject solution with above error (in title of this issue).

Expected behavior

Expect them to both work

Actual behavior

Multiproject solution gives following error at runtime: “The type initializer for ‘LibGit2Sharp.Core.NativeMethods’ threw an exception”

Version of LibGit2Sharp (release number or SHA1)

0.25.0 (same issue was present on 0.24.0 at least)

Operating system(s) tested; .NET runtime tested

Windows 7, 4.6.1 (doesn’t work), .NET Core 2.0 (works)

Note that I initially created a Stack Overflow question for this, available here: https://stackoverflow.com/questions/50355388/the-type-initializer-for-libgit2sharp-core-nativemethods-threw-an-exception?noredirect=1#comment87728615_50355388

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions