我有一个.NET 4.6 Web应用程序在64位Azure应用服务中运行。当我遇到一个调用LibGit2Sharp的控制器时,出现以下异常:
[BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)]
这是堆栈跟踪:
LibGit2Sharp.Core.NativeMethods.git_repository_new(git_repository*& repo):-1
LibGit2Sharp.Core.Proxy.git_repository_new() in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Core\Proxy.cs:2553
LibGit2Sharp.Repository.ListRemoteReferences(String url, CredentialsHandler credentialsProvider) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Repository.cs:633
此代码在本地可以正常工作,所以我无法弄清楚出了什么问题。
我遇到了相同的问题(使用DOTNET 4.7.2),关于此问题的结论是什么?