Skip to content

Commit

Permalink
Revert "Fixed an issue with Melons and UserLibs becoming File Locked …
Browse files Browse the repository at this point in the history
…after Loading"

This reverts commit eafab46.
  • Loading branch information
HerpDerpinstine committed Oct 14, 2024
1 parent eafab46 commit 30b8638
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion MelonLoader/Melons/MelonAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public static MelonAssembly LoadMelonAssembly(string path, bool loadMelons = tru

try
{
return LoadRawMelonAssembly(path, File.ReadAllBytes(path), null, loadMelons);
#if NET6_0_OR_GREATER
var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(path);
#else
var assembly = Assembly.LoadFrom(path);
#endif
return LoadMelonAssembly(path, assembly, loadMelons);
}
catch (Exception ex)
{
Expand Down
3 changes: 2 additions & 1 deletion MelonLoader/Melons/MelonFolderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ private static void ProcessFolder<T>(string path,

// Get Directories
var directories = Directory.GetDirectories(path, "*", SearchOption.AllDirectories);

// Add Directories to Resolver
if ((directories != null) && (directories.Length > 0))
{
// Add Directories to Resolver
foreach (var dir in directories)
{
// Validate Path
Expand Down

0 comments on commit 30b8638

Please sign in to comment.