Skip to content

Commit 48460d0

Browse files
committed
Fix Assembly CodeBase warning
1 parent f178934 commit 48460d0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

LibGit2Sharp/GlobalSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class GlobalSettings
2020

2121
private static string nativeLibraryPath;
2222
private static bool nativeLibraryPathLocked;
23-
private static string nativeLibraryDefaultPath;
23+
private static readonly string nativeLibraryDefaultPath = null;
2424

2525
static GlobalSettings()
2626
{
@@ -29,19 +29,18 @@ static GlobalSettings()
2929

3030
nativeLibraryPathAllowed = netFX || netCore;
3131

32+
#if NETFRAMEWORK
3233
if (netFX)
3334
{
3435
// For .NET Framework apps the dependencies are deployed to lib/win32/{architecture} directory
3536
nativeLibraryDefaultPath = Path.Combine(GetExecutingAssemblyDirectory(), "lib", "win32", Platform.ProcessorArchitecture);
3637
}
37-
else
38-
{
39-
nativeLibraryDefaultPath = null;
40-
}
38+
#endif
4139

4240
registeredFilters = new Dictionary<Filter, FilterRegistration>();
4341
}
4442

43+
#if NETFRAMEWORK
4544
private static string GetExecutingAssemblyDirectory()
4645
{
4746
// Assembly.CodeBase is not actually a correctly formatted
@@ -66,6 +65,7 @@ private static string GetExecutingAssemblyDirectory()
6665
managedPath = Path.GetDirectoryName(managedPath);
6766
return managedPath;
6867
}
68+
#endif
6969

7070
/// <summary>
7171
/// Returns information related to the current LibGit2Sharp

0 commit comments

Comments
 (0)