Skip to content

Commit

Permalink
Limit use of CodeBase to .NET Framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
farzonl committed Sep 6, 2023
1 parent 624e0c8 commit 6f70157
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/common/nativelibrary_for_netstandard2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ LibSuffix suffix
a.Add(Path.Combine(dir, libname));
}

if ((flags & WHERE_CODEBASE) != 0)
if ((flags & WHERE_CODEBASE) != 0 &&
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework")
)
{
var dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
a.Add(new Uri(Path.Combine(dir, libname)).AbsolutePath);
var dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
a.Add(new Uri(Path.Combine(dir, libname)).AbsolutePath);
}

return a;
Expand Down

0 comments on commit 6f70157

Please sign in to comment.