Skip to content

Commit

Permalink
updating .NET Core dependency resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Nov 22, 2024
1 parent f1af562 commit 42ec0a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/double/Edge.js/dotnetcore/coreclrembedding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected override Assembly Load(AssemblyName assemblyName)
try
{
DebugMessage("EdgeAssemblyLoadContext::Load (CLR) - Trying to load from {0}", assemblyPath);
Assembly assembly = LoadFromAssemblyPath(assemblyPath);
Assembly assembly = Default.LoadFromAssemblyPath(assemblyPath);

if (assembly != null)
{
Expand Down Expand Up @@ -291,7 +291,6 @@ private void AddDependencies(DependencyContext dependencyContext, bool standalon
assemblyPath = Path.Combine(_packagesPath, runtimeLibrary.Name.ToLower(), runtimeLibrary.Version, assetPath.Replace('/', Path.DirectorySeparatorChar));

}
DebugMessage("EdgeAssemblyResolver::AddDependencies (CLR) - Assembly path {0}", assemblyPath);
string libraryNameFromPath = Path.GetFileNameWithoutExtension(assemblyPath);

if (!File.Exists(assemblyPath) && !string.IsNullOrEmpty(runtimePath))
Expand Down Expand Up @@ -388,7 +387,7 @@ private void AddDependencyFromRuntime(RuntimeLibrary runtimeLibrary)
}

var asset = runtimeLibrary.Name;
if (!asset.EndsWith(".dll"))
if (!asset.EndsWith(".dll") && !asset.EndsWith(".sni"))
{
asset += ".dll";
}
Expand All @@ -398,6 +397,11 @@ private void AddDependencyFromRuntime(RuntimeLibrary runtimeLibrary)
asset = "System.dll";
}

if (asset == "NETStandard.Library.dll")
{
asset = "netstandard.dll";
}

var assemblyPath = Path.Combine(runtimePath, Path.GetFileName(asset));
if (File.Exists(assemblyPath))
{
Expand Down Expand Up @@ -428,7 +432,7 @@ private void AddDependencyFromAppDirectory(RuntimeLibrary runtimeLibrary)
DebugMessage("EdgeAssemblyResolver::AddDependencies (CLR) - Processing dependency {1} {0} using .nuget packages and ApplicationDirectory path.", runtimeLibrary.Name, runtimeLibrary.Type);

var asset = runtimeLibrary.Name;
if (!asset.EndsWith(".dll"))
if (!asset.EndsWith(".dll") && !asset.EndsWith(".sni"))
{
asset += ".dll";
}
Expand Down

0 comments on commit 42ec0a4

Please sign in to comment.