nulastudio / NetBeauty2

Move a .NET Framework/.NET Core app runtime components and dependencies into a sub-directory and make it beauty.
MIT License
419 stars 21 forks source link

libSystem.Native disappears when NetBeauty2 is invoked for non-Windows platforms #30

Closed s5bug closed 2 years ago

s5bug commented 2 years ago

Without NetBeauty2:

image

With NetBeauty2:

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'Avalonia.Win32, Version=0.10.13.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'. Could not find the specified DllImport Dll.
File name: 'Avalonia.Win32, Version=0.10.13.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'
 ---> System.DllNotFoundException: Unable to load shared library 'libSystem.Native' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibSystem.Native, 0x0001): tried: 'liblibSystem.Native' (no such file), '/usr/local/lib/liblibSystem.Native' (no such file), '/usr/lib/liblibSystem.Native' (no such file), '/Users/#####/Downloads/emufish-osx-arm64-self-contained/liblibSystem.Native' (no such file)
   at Interop.Sys.LStat(Byte& path, FileStatus& output)
   at Interop.Sys.LStat(ReadOnlySpan`1 path, FileStatus& output)
   at System.IO.FileSystem.FileExists(ReadOnlySpan`1 fullPath, ErrorInfo& errorInfo)
   at System.IO.FileSystem.FileExists(ReadOnlySpan`1 fullPath)
   at System.IO.File.Exists(String path)
   at NetBeauty.NBLoader.ManagedAssemblyResolver(AssemblyLoadContext context, AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
fish: Job 1, './EmuFish' terminated by signal SIGABRT (Abort)

image

s5bug commented 2 years ago

image

Same issue happens on Linux, which is more impactful because Linux (as far as I'm aware) doesn't have something like Mac's .app which nullifies the need for NetBeauty.