GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

Ubuntu 19.04 GitVersion Error System.BadImageFormatException: Method has no body File name: 'LibGit2Sharp

Open richardbizik opened this issue 7 years ago • 2 comments

Hi, I am getting this error whenever I try to run gitversion on ubuntu 19.04.

riso@riso-XPS-13-9370:/opt/gitversion$ mono GitVersion.exe
INFO [08/30/19 9:04:55:60] Working directory: /opt/gitversion
INFO [08/30/19 9:04:55:62] IsDynamicGitRepository: False
ERROR [08/30/19 9:04:55:62] An unexpected error occurred:
System.BadImageFormatException: Method has no body
File name: 'LibGit2Sharp'
  at LibGit2Sharp.Core.Proxy.git_buf_dispose (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <5e2d125af12e4bcc982f89d05fe51418>:0 
  at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <5e2d125af12e4bcc982f89d05fe51418>:0 
  at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2[T,TResult] pathRetriever) [0x0002e] in <5e2d125af12e4bcc982f89d05fe51418>:0 
  at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <5e2d125af12e4bcc982f89d05fe51418>:0 
  at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <5e2d125af12e4bcc982f89d05fe51418>:0 
  at GitVersion.GitPreparer.GetDotGitDirectory () [0x0000f] in <071403b114fe405b98c9cdb996d935e6>:0 
  at GitVersion.GitPreparer.GetProjectRootDirectory () [0x00048] in <071403b114fe405b98c9cdb996d935e6>:0 
  at GitVersion.ConfigFileLocator.Verify (GitVersion.GitPreparer gitPreparer, GitVersion.Helpers.IFileSystem fileSystem) [0x00015] in <071403b114fe405b98c9cdb996d935e6>:0 
  at GitVersion.Program.VerifyConfiguration (GitVersion.Arguments arguments, GitVersion.Helpers.IFileSystem fileSystem) [0x0002a] in <071403b114fe405b98c9cdb996d935e6>:0 
  at GitVersion.Program.VerifyArgumentsAndRun () [0x0011d] in <071403b114fe405b98c9cdb996d935e6>:0 

I found the issue https://github.com/GitTools/GitVersion/issues/1483 but it does not seem to be fixed. I am running on version:

riso@riso-XPS-13-9370:/opt/gitversion$ mono GitVersion.exe /version
5.0.1+Branch.master.Sha.c71b8fc9f6d7b6adffe82fef588e717beb864e91

richardbizik avatar Aug 30 '19 07:08 richardbizik

#1483 was indeed fixed, but the library we are using Libgit2Sharp does not support Ubuntu 19.04 yet. When there will be a version that supports that we'll also update on our side. For now Ubuntu 18.04 is the latest version we support

arturcic avatar Aug 30 '19 07:08 arturcic

Libgit2Sharp also has some issues when running with mono. When they have the fix, we can include it as well

arturcic avatar Aug 30 '19 07:08 arturcic