Skip to content
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

Compatibility with Cake CoreCLR #365

Closed
flcdrg opened this issue Jul 19, 2019 · 6 comments · Fixed by #434
Closed

Compatibility with Cake CoreCLR #365

flcdrg opened this issue Jul 19, 2019 · 6 comments · Fixed by #434

Comments

@flcdrg
Copy link
Contributor

flcdrg commented Jul 19, 2019

Trying to use Cake.Gitversioning with Cake.CoreCLR with a .cake file like:

#addin nuget:?package=Cake.GitVersioning&version=2.3.183

var gitVersion = GitVersioningGetVersion();

results in the following error:

Error: System.AggregateException: One or more errors occurred. (The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.) ---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'git2-572e4d8': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()

A workaround for this is to manually copy the platform-specific git2-572e4d8.dll file from tools\Addins\Cake.GitVersioning.2.3.183\lib\netstandard2.0\lib\win32\x64\git2-572e4d8.dll into tools\Addins\Cake.GitVersioning.2.3.183\lib\netstandard2.0\lib (eg. the same directory as LibGit2Sharp.dll)

Not sure if there's a better way to deal with this - but noting it here in case anyone else has the same problem.

@AArnott
Copy link
Collaborator

AArnott commented Aug 4, 2019

@japj Can you help here?

@AArnott
Copy link
Collaborator

AArnott commented Oct 15, 2019

@japj Any ideas? At the moment, the cake plugin actually references a project that dual targets net461 and netcoreapp2.0 but I want to update that to netcoreapp2.1 and net472. The cake plugin targets netstandard2.0 which is a misnomer since in fact we can't target netstandard2.0 due to the dependency on platform-specific code.

Is there a way for the Cake plugin to properly support .NET Core given our dependency on native binaries?

@japj
Copy link
Contributor

japj commented Oct 15, 2019

@AArnott I’m not entirely sure, but I think the important part to remember here is that the nbgv nuget package is a tools/MSBuild nuget.

I have no experience with cake and addins. Perhaps there is some documentation that can help understand how that exactly works?

@AArnott
Copy link
Collaborator

AArnott commented Oct 15, 2019

Ah, I thought you might be the Cake guy. :)
I tried looking for docs but all of them that I could find seem to be oriented around consuming cake addins rather than authoring them.

@flcdrg
Copy link
Contributor Author

flcdrg commented Nov 11, 2019

@gep13 any ideas?

@gep13
Copy link

gep13 commented Nov 11, 2019

@flcdrg thanks for the shout out... This is more of a @devlead question. He might have ran into similar when doing the Cake.Git addin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants