Reputation: 1596
I am working on .Net Core and trying to migrate the >net 4.5 application into .Net core. During this process, i am finding the following error when trying to access git .dll
following is my Project.json:
"frameworks": {
"net451": {
"dependencies": {
"Data": "1.0.0-*",
"NLog": "4.3.5",
"HtmlAgilityPack": "1.4.9",
"LibGit2Sharp": "0.22.0",
"RestSharp": "105.2.3",
"Unofficial.Ionic.Zip": "1.9.1.8"
}
}
and here i receives and error on below line of code.
if (Repository.IsValid(basePath) == false)
Namespaces are included:
using LibGit2Sharp;
using LibGit2Sharp.Handlers;
error message is:
Unable to load DLL 'git2-785d8c4': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
i want to know if there is any other method through which i can use this functionality in .Net Core.
Upvotes: 3
Views: 897
Reputation: 78703
Update: Beginning with the August 3rd build of LibGit2Sharp (LibGit2Sharp 0.23.0-pre20160803182831), LibGit2Sharp now supports both regular .NET 4.5 projects (those using .csproj
-based solutions) and new-style project.json
-based solutions (like introduced in .NET Core).
Note that LibGit2Sharp still does not support .NET Core, only the new project structure. Please see https://github.com/libgit2/libgit2sharp/pull/1318 for updates.
Upvotes: 2
Reputation: 244848
The LibGit2Sharp package depends on the LibGit2Sharp.NativeBinaries package. Since that's a native package, it uses an MSBuild file to copy the native library to the output directory.
.Net Core CLI does not use MSBuild, and I believe as a consequence of that, it does not support MSBuild-based native packages.
If you want to use the LibGit2Sharp package with .Net Core CLI, I believe you will have to wait: the next version of .Net Core CLI (planned for fall 2016) will use MSBuild, so it's possible it will just start working. Alternatively, the authors of LibGit2Sharp might release a compatible package in the future.
Upvotes: 1