From a318a9101f0fbb6aa128f98aeb81ca00d8af3091 Mon Sep 17 00:00:00 2001 From: Louis Zanella Date: Fri, 19 Jul 2024 08:39:46 -0400 Subject: [PATCH] Target netstandard2.0 rather than net472 Targeting netstandard2.0 will make LibGit2Sharp more versatile. --- LibGit2Sharp/Core/NativeMethods.cs | 2 +- LibGit2Sharp/GlobalSettings.cs | 4 ++-- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index e8e59843e..68f23d6b5 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -66,7 +66,7 @@ private static string GetGlobalSettingsNativeLibraryPath() return Path.Combine(nativeLibraryDir, libgit2 + Platform.GetNativeLibraryExtension()); } -#if NETFRAMEWORK +#if NETSTANDARD private static bool TryUseNativeLibrary() => false; #else private static bool TryUseNativeLibrary() diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs index bf7875f96..035418759 100644 --- a/LibGit2Sharp/GlobalSettings.cs +++ b/LibGit2Sharp/GlobalSettings.cs @@ -29,7 +29,7 @@ static GlobalSettings() nativeLibraryPathAllowed = netFX || netCore; -#if NETFRAMEWORK +#if NETSTANDARD if (netFX) { // For .NET Framework apps the dependencies are deployed to lib/win32/{architecture} directory @@ -40,7 +40,7 @@ static GlobalSettings() registeredFilters = new Dictionary(); } -#if NETFRAMEWORK +#if NETSTANDARD private static string GetExecutingAssemblyDirectory() { // Assembly.CodeBase is not actually a correctly formatted diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 28404d948..a0f6f45d9 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,7 +1,7 @@  - net472;net6.0 + netstandard2.0;net6.0 10.0 true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET