Skip to content

Commit

Permalink
fix(linux): Force load of colocated bootstrapper tooling assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 8, 2020
1 parent 4ccfd1d commit fb5cd94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -157,6 +158,7 @@ public override bool Execute()

// Debugger.Launch();

PreloadAssemblies();
TryEnableLongPathAware();
ParseProperties();
GetBcl();
Expand Down Expand Up @@ -184,6 +186,20 @@ public override bool Execute()
}
}

private void PreloadAssemblies()
{
// Under some circumstances, the assemblies bundled with the bootstrapper do not
// get loaded properly by .NET Core. This is method forces the loading of those
// assemblies in order to let the loading find them automatically.

var path = Path.GetDirectoryName(new Uri(GetType().Assembly.GetName().CodeBase).LocalPath);

foreach (var file in Directory.GetFiles(path, "*.dll"))
{
_ = System.Reflection.Assembly.LoadFile(Path.Combine(path, file));
}
}

private void TryEnableLongPathAware()
{
if (EnableLongPathSupport)
Expand Down

0 comments on commit fb5cd94

Please sign in to comment.