diff --git a/.gitignore b/.gitignore
index 32e17b4d0..e16a0b461 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,5 @@ _ReSharper*/
_NCrunch_LibGit2Sharp/
artifacts/
worktree.playlist
+**/Properties/AssemblyInfo.net*.cs
+**/Properties/AssemblyInfoCommon.net*.cs
diff --git a/Directory.Build.props b/Directory.Build.props
index 2c14cc2bd..999f8f1e6 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -3,7 +3,6 @@
true
true
- true
$(DefineConstants);$(ExtraDefine)
@@ -11,4 +10,6 @@
true
+
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
new file mode 100644
index 000000000..f98e4abdc
--- /dev/null
+++ b/Directory.Build.targets
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj
index fb81a76a3..b55c95362 100644
--- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj
+++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj
@@ -1,7 +1,7 @@
- net472;net8.0;net9.0
+ net10.0
diff --git a/LibGit2Sharp/CertificateX509.cs b/LibGit2Sharp/CertificateX509.cs
index 7b5b0fac6..7173f609e 100644
--- a/LibGit2Sharp/CertificateX509.cs
+++ b/LibGit2Sharp/CertificateX509.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using LibGit2Sharp.Core;
@@ -26,7 +26,11 @@ internal unsafe CertificateX509(git_certificate_x509* cert)
int len = checked((int)cert->len.ToUInt32());
byte[] data = new byte[len];
Marshal.Copy(new IntPtr(cert->data), data, 0, len);
- Certificate = new X509Certificate(data);
+#if NETCOREAPP
+ Certificate = X509CertificateLoader.LoadCertificate(data);
+#else
+ Certificate = new X509Certificate(data);
+#endif
}
internal CertificateX509(X509Certificate cert)
diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs
index cbb850b16..28b90a254 100644
--- a/LibGit2Sharp/Core/NativeMethods.cs
+++ b/LibGit2Sharp/Core/NativeMethods.cs
@@ -73,7 +73,7 @@ private static string GetGlobalSettingsNativeLibraryPath()
#else
private static bool TryUseNativeLibrary()
{
- NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, ResolveDll);
+ //NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, ResolveDll);
return true;
}
diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj
index 1c4abef7b..79a1d710a 100644
--- a/LibGit2Sharp/LibGit2Sharp.csproj
+++ b/LibGit2Sharp/LibGit2Sharp.csproj
@@ -1,8 +1,15 @@
-
+
- net472;net8.0
- 12.0
+
+ AnyCPU
+ AnyCPU
+
+
+
+ net10.0
+ true
+ false
true
LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET
LibGit2Sharp contributors
@@ -12,25 +19,37 @@
LibGit2Sharp contributors
true
true
- embedded
true
- ..\libgit2sharp.snk
+ $(RepoRootDir)Snk.snk
square-logo.png
App_Readme/README.md
App_Readme/LICENSE.md
true
- $(ArtifactsPath)\package
+ $(OutputPath)\package
preview.0
libgit2-$(libgit2_hash.Substring(0,7))
-
+
+
+ net10.0;net472
+
+
+
true
+ $(NoWarn);NU5128
-
-
+
+
+
+
+
+
+
+
+
@@ -52,10 +71,6 @@
-
-
- $(MinVerMajor).$(MinVerMinor).0.0
-
-
+
-
+
diff --git a/LibGit2Sharp/Properties/AssemblyInfo.Template.cs b/LibGit2Sharp/Properties/AssemblyInfo.Template.cs
new file mode 100644
index 000000000..961a3cdce
--- /dev/null
+++ b/LibGit2Sharp/Properties/AssemblyInfo.Template.cs
@@ -0,0 +1,26 @@
+// TEMPLATE:.+
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("LibGit2Sharp")]
+[assembly: AssemblyDefaultAlias("LibGit2Sharp")]
+[assembly: AssemblyDescription("LibGit2Sharp Library for handling of Git repositories.")]
+[assembly: AssemblyConfiguration("__LIBRARY_CONFIGURATION__")]
+[assembly: AssemblyPlatform("__LIBRARY_PLATFORM__")]
+[assembly: AssemblyCulture("")]
+
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("107A6B04-09CB-4ADD-87E0-5B5DF0B09BFE")]
+
+
+[assembly: InternalsVisibleTo("DjvuNet.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001004dc7a384af8b33357ae286a9c208740e12580e26c93cfc529e38460986c19e382c23406f34eca0bf2baae3e9d69157c1f66675ac0d419c39028e070fcb687935aae49ee53cc85ea3faed79aeefe48f25a97ccecf02d983b2d71e92b7ebd71eb109b886b2cafa5cc9c8e915c6b802d0e975b44a7a5252c5693e8fa53a49fc36c2")]
+[assembly: InternalsVisibleTo("DjvuNet.Helper.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001004dc7a384af8b33357ae286a9c208740e12580e26c93cfc529e38460986c19e382c23406f34eca0bf2baae3e9d69157c1f66675ac0d419c39028e070fcb687935aae49ee53cc85ea3faed79aeefe48f25a97ccecf02d983b2d71e92b7ebd71eb109b886b2cafa5cc9c8e915c6b802d0e975b44a7a5252c5693e8fa53a49fc36c2")]
+[assembly: InternalsVisibleTo("DjvuNet.Wavelet.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001004dc7a384af8b33357ae286a9c208740e12580e26c93cfc529e38460986c19e382c23406f34eca0bf2baae3e9d69157c1f66675ac0d419c39028e070fcb687935aae49ee53cc85ea3faed79aeefe48f25a97ccecf02d983b2d71e92b7ebd71eb109b886b2cafa5cc9c8e915c6b802d0e975b44a7a5252c5693e8fa53a49fc36c2")]
+[assembly: InternalsVisibleTo("DjvuNet.DjvuLibre.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001004dc7a384af8b33357ae286a9c208740e12580e26c93cfc529e38460986c19e382c23406f34eca0bf2baae3e9d69157c1f66675ac0d419c39028e070fcb687935aae49ee53cc85ea3faed79aeefe48f25a97ccecf02d983b2d71e92b7ebd71eb109b886b2cafa5cc9c8e915c6b802d0e975b44a7a5252c5693e8fa53a49fc36c2")]
+[assembly: InternalsVisibleTo("DjvuNetTest,PublicKey=00240000048000009400000006020000002400005253413100040000010001004dc7a384af8b33357ae286a9c208740e12580e26c93cfc529e38460986c19e382c23406f34eca0bf2baae3e9d69157c1f66675ac0d419c39028e070fcb687935aae49ee53cc85ea3faed79aeefe48f25a97ccecf02d983b2d71e92b7ebd71eb109b886b2cafa5cc9c8e915c6b802d0e975b44a7a5252c5693e8fa53a49fc36c2")]
diff --git a/NativeLibraryLoadTestApp/x64/NativeLibraryLoadTestApp.x64.csproj b/NativeLibraryLoadTestApp/x64/NativeLibraryLoadTestApp.x64.csproj
index 3bca18b34..afcfcf592 100644
--- a/NativeLibraryLoadTestApp/x64/NativeLibraryLoadTestApp.x64.csproj
+++ b/NativeLibraryLoadTestApp/x64/NativeLibraryLoadTestApp.x64.csproj
@@ -2,7 +2,7 @@
Exe
- net472
+ net10.0
x64
diff --git a/NativeLibraryLoadTestApp/x86/NativeLibraryLoadTestApp.x86.csproj b/NativeLibraryLoadTestApp/x86/NativeLibraryLoadTestApp.x86.csproj
index 0596f203c..6a921f228 100644
--- a/NativeLibraryLoadTestApp/x86/NativeLibraryLoadTestApp.x86.csproj
+++ b/NativeLibraryLoadTestApp/x86/NativeLibraryLoadTestApp.x86.csproj
@@ -2,7 +2,7 @@
Exe
- net472
+ net10.0
x86
diff --git a/README.md b/README.md
index 96aa2bbd1..f5deb47e0 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,14 @@
# LibGit2Sharp
-[](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml)
+[](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml)
[](https://www.nuget.org/packages/LibGit2Sharp/)
**LibGit2Sharp brings all the might and speed of [libgit2](https://libgit2.org/), a native Git implementation, to the managed world of .NET**
+## Fork used by DjvuNet project
+
+This repository is modified for easy OS and platform multitargeting and reliable, improved native dependency resolution during runtime. It also supports sharing the same build directory between different OSes and platforms when used during the build process as a universal build tool. It supports scenarios like network share usage from different clients and Windows/WSL directory sharing.
+
## Online resources
- [NuGet package](http://nuget.org/List/Packages/LibGit2Sharp)