Просмотр исходного кода

Fix assembly resolving on locales in paths with non-ASCII chars
Rebase of d81aca7

Bepis 4 лет назад
Родитель
Сommit
46d18dce4f
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      BepInEx.Preloader.Unity/DoorstopEntrypoint.cs

+ 3 - 1
BepInEx.Preloader.Unity/DoorstopEntrypoint.cs

@@ -30,8 +30,10 @@ namespace BepInEx.Preloader.Unity
 		{
 			var assemblyName = new AssemblyName(args.Name);
 
+			// Use parse assembly name on managed side because native GetName() can fail on some locales
+			// if the game path has "exotic" characters
 			var foundAssembly = AppDomain.CurrentDomain.GetAssemblies()
-										 .FirstOrDefault(x => x.GetName().Name == assemblyName.Name);
+										 .FirstOrDefault(x => new AssemblyName(x.FullName).Name == assemblyName.Name);
 
 			if (foundAssembly != null)
 				return foundAssembly;