Skip to content

Commit

Permalink
Don't append arch to NativeLibraryPath
Browse files Browse the repository at this point in the history
  • Loading branch information
bording committed Nov 9, 2021
1 parent 2bde4cb commit b6d3e2f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions LibGit2Sharp/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static GlobalSettings()
if (netFX)
{
// For .NET Framework apps the dependencies are deployed to lib/win32/{architecture} directory
nativeLibraryDefaultPath = Path.Combine(GetExecutingAssemblyDirectory(), "lib", "win32");
nativeLibraryDefaultPath = Path.Combine(GetExecutingAssemblyDirectory(), "lib", "win32", Platform.ProcessorArchitecture);
}
else
{
Expand Down Expand Up @@ -159,8 +159,6 @@ public static LogConfiguration LogConfiguration
/// <summary>
/// Sets a path for loading native binaries on .NET Framework or .NET Core.
/// When specified, native library will first be searched under the given path.
/// On .NET Framework a subdirectory corresponding to the architecture ("x86" or "x64") is appended,
/// otherwise the native library is expected to be found in the directory as specified.
///
/// If the library is not found it will be searched in standard search paths:
/// <see cref="DllImportSearchPath.AssemblyDirectory"/>,
Expand All @@ -170,10 +168,6 @@ public static LogConfiguration LogConfiguration
/// This must be set before any other calls to the library,
/// and is not available on other platforms than .NET Framework and .NET Core.
/// </para>
/// <para>
/// If not specified on .NET Framework it defaults to lib/win32 subdirectory
/// of the directory where this assembly is loaded from.
/// </para>
/// </summary>
public static string NativeLibraryPath
{
Expand Down Expand Up @@ -213,8 +207,7 @@ public static string NativeLibraryPath
internal static string GetAndLockNativeLibraryPath()
{
nativeLibraryPathLocked = true;
string result = nativeLibraryPath ?? nativeLibraryDefaultPath;
return Platform.IsRunningOnNetFramework() ? Path.Combine(result, Platform.ProcessorArchitecture) : result;
return nativeLibraryPath ?? nativeLibraryDefaultPath;
}

/// <summary>
Expand Down

0 comments on commit b6d3e2f

Please sign in to comment.