-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.BadImageFormatException: Method has no body on CentOS #1637
Comments
I don't know what you mean when you say that you use cake to automate the build process... It looks like cake is actually calling directly to LibGit2Sharp? I assume that it's capable of running scripts or something? And that you're creating a script that opens a repository? |
Yes, it does. I've created a repository with a sample Take attention that you've to have an installed mono. P.S. Thank you for the great library and fast support :) |
That repo you just created has an error message from macOS, but up top you mention that macOS works - can you clarify? |
Extremely good point, sorry for confusing. The created test project also have a problem on MacOS, but it's a little bit different from the problem I have on CentOS. Could you run that script to check it? I think I should change the description of the issue. Interesting thing: if you add the line Note: the script in the test project is different to another one I run on CentOS. But unfortunately the test script also has a problem. |
@kostyaVyrodov I've seen other reports of the same error (Method has no body) when running on mono, so I think there's something wrong somewhere that is making LibGit2Sharp and mono very unhappy with each other. I've not had time to investigate the specifics yet, though. On a side note, even if you weren't getting that error, you likely wouldn't be able to run on CentOS by default. You'll need to edit LibGit2Sharp.dll.config to point to the |
I'm also seeing this error on Debian 9 when using Cake -
|
@austinlparker Is that from mono or .NET Core? |
Mono 5.16.0.179
…On Mon, Nov 12, 2018 at 9:25 PM Brandon Ording ***@***.***> wrote:
@austinlparker <https://github.com/austinlparker> Is that from mono or
.NET Core?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD8uxHLy4GJWnSqqLmkrvY9cSOVijS4mks5uui2sgaJpZM4YQgSo>
.
|
The exception mentioned in this issue also appears when using the official Mono docker image:
|
Having the same error on a AWS Linux image with latest mono (Mono JIT compiler version 5.16.0.220 ) |
I switched to the old Cake.Git version 0.18.0 (using libgit2sharp 0.24.10) which works as expected. |
There is definitely some sort of compatibility problem between recent versions of LibGit2Sharp and mono, but I haven't had time to investigate the cause. |
thanks @bording @t081as : I tried using the old Cake.git (0.18.0), but it didn't work for me. However, what I'm trying to do is use GitVersion with Cake Build on a Linux machine running mono. From my investigation (also confirmed here "GitTools/GitVersion#1097") the issue seems to be introduce by a recent version of libgit2. If I manually change GitVersion to us libgit2 v0.27.0 I don't have this issue. |
@kostyaVyrodov were you able to resolve this issue? recently, i ran into same issue with Xamarin project while using libgit2sharp nuget v0.26.0.
I do not use cake but, expecting same fix would help here.. I fixed this issue in my project by referencing "LibGit2Sharp.NativeBinaries" package to executable file and it worked. Can you make sure "libgit2-*.so" file is properly linked to your executable? |
@pastmaster007. I am having the same issue. Could you please explain your fix further?
My LibGit2Sharp.NativeBinaries is implicitly included as a dependency of LibGit2Sharp by NuGet. There is no way I can see to add an explicit reference.
Thanks |
Reproduction steps
I use CAKE to automate build process. I run my build script on CentOS and it throws an exception
To reproduce the issue, try to create an instance of the 'Repository' class.
I've created a test project reproducing similar error, but on MacOS.
I also use CAKE script, but the original one is more complex than the test one, but in any way the library also throws similar exception related to native methods.
Actual behavior
Expected behavior
The constructor returns an instance of the Repository
Version of LibGit2Sharp (release number or SHA1)
v0.25.3
Operating system(s) tested; .NET runtime tested
The text was updated successfully, but these errors were encountered: