question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repository.Clone() not working within a Azure Function (Unable to load DLL 'git2-6311e88')

See original GitHub issue

I’m trying to clone repositories in an Azure Function to determine if repositories are up and cloneable.

The following code does work in a Console App (.NET Core) project but not in an Azure function project

var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D"));
Directory.CreateDirectory(tempPath);

var cloneDirectory = Path.Combine(tempPath, "clone");

var repositoryLocation = @"https://github.com/anthonyhuebers/GitClone.git";
var cloneResult = Repository.Clone(repositoryLocation, cloneDirectory, new CloneOptions());

In an Azure function project i get the following exception message:

The type initializer for ‘LibGit2Sharp.Core.NativeMethods’ threw an exception.

With inner exception:

Unable to load DLL ‘git2-6311e88’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Any idea why it’s not working? You can reproduce the problem by checking my git repository: https://github.com/anthonyhuebers/GitClone. I’m using LibGit2Sharp 0.25.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ethomsoncommented, Jan 15, 2019

(Oops it was already closed. In that case I’m reopening it accidentally so that I can dramatically close it again.)

1reaction
anthonyhueberscommented, May 17, 2018

This morning I solved the problem. I used an Azure Function v1 (.NET Framework instead of .NET Standard) with the LibGit2Sharp 0.21.0.176. When you include the native binary in the release it is working!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure functions: Unable to load DLL 'sni.dll' or one of its ...
It looks like something is wrong with the connection string. Please check that you are you using something similar to this:
Read more >
Git clone or Git push fails to an Azure DevOps repository
This article discusses problems that might occur when you try to perform Git clone or Git push function to an Azure DevOps repository....
Read more >
Azure Function Could not load file or assembly ...
I implemented an application "Azure Functions" that makes use of "Microsoft.IdentityModel.Protocols.OpenIdConnect" to authenticate the session of a user, ...
Read more >
Authenticating Azure AD Function fails with "Could not load ...
After adding the file, right-click on it in the Solution Explorer and choose "Properties." In the properties window, set "Copy to Output ...
Read more >
Clone an existing Git repo - Azure DevOps
In the Clone a repository window, select Azure DevOps under Browse a repository to open the Connect to a Project window.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found