Skip to content

Commit

Permalink
fix(hr): Fix assembly loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Jan 23, 2025
1 parent 88923ca commit 7060cf0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
1 change: 1 addition & 0 deletions build/nuget/Uno.WinUI.DevServer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
<file src="..\..\src\Uno.UI.RemoteControl.Server.Processors\bin\Release\net8.0\*.pdb" target="tools\rc\processors\net8.0" />
<file src="..\..\src\Uno.UI.RemoteControl.Server.Processors\bin\Release\net9.0\*.dll" target="tools\rc\processors\net9.0" />
<file src="..\..\src\Uno.UI.RemoteControl.Server.Processors\bin\Release\net9.0\*.pdb" target="tools\rc\processors\net9.0" />
<file src="..\..\src\Uno.UI.RemoteControl.Server.Processors\bin\Release\net9.0\BuildHost-netcore\**" target="tools\rc\processors\net9.0\BuildHost-netcore" />

<!-- Build targets -->
<file src="..\..\src\Uno.UI.RemoteControl\buildTransitive\*" target="buildTransitive" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,35 +191,6 @@ private static void RegisterAssemblyLoader()
return null;
}

// Lookup for the highest version matching assembly in the current app domain.
// There may be an existing one that already matches, even though the
// fusion loader did not find an exact match.
var loadedAsm = (
from asm in AppDomain.CurrentDomain.GetAssemblies()
where asm.GetName().Name == assembly.Name
orderby asm.GetName().Version descending
select asm
).ToArray();

if (loadedAsm.Length > 1)
{
var duplicates = loadedAsm
.Skip(1)
.Where(a => a.GetName().Version == loadedAsm[0].GetName().Version)
.ToArray();

if (duplicates.Length != 0)
{
Console.WriteLine($"Selecting first occurrence of assembly [{name}] which can be found at [{duplicates.Select(d => d.Location).JoinBy("; ")}]");
}

return loadedAsm[0];
}
else if (loadedAsm.Length == 1)
{
return loadedAsm[0];
}

Assembly? LoadAssembly(string filePath)
{
if (File.Exists(filePath))
Expand Down

0 comments on commit 7060cf0

Please sign in to comment.