1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Fix assembly location lookups

This commit is contained in:
Dean Herbert 2022-12-16 19:06:11 +09:00
parent de079e08dc
commit dd9a418549
2 changed files with 2 additions and 3 deletions

View File

@ -185,7 +185,7 @@ namespace osu.Game.Tests.Beatmaps
private Stream openResource(string name) private Stream openResource(string name)
{ {
string localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().Location).Path)).AsNonNull(); string localPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).AsNonNull();
return Assembly.LoadFrom(Path.Combine(localPath, $"{ResourceAssembly}.dll")).GetManifestResourceStream($@"{ResourceAssembly}.Resources.{name}"); return Assembly.LoadFrom(Path.Combine(localPath, $"{ResourceAssembly}.dll")).GetManifestResourceStream($@"{ResourceAssembly}.Resources.{name}");
} }

View File

@ -3,7 +3,6 @@
#nullable disable #nullable disable
using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using NUnit.Framework; using NUnit.Framework;
@ -54,7 +53,7 @@ namespace osu.Game.Tests.Beatmaps
private Stream openResource(string name) private Stream openResource(string name)
{ {
string localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().Location).Path)).AsNonNull(); string localPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).AsNonNull();
return Assembly.LoadFrom(Path.Combine(localPath, $"{ResourceAssembly}.dll")).GetManifestResourceStream($@"{ResourceAssembly}.Resources.{name}"); return Assembly.LoadFrom(Path.Combine(localPath, $"{ResourceAssembly}.dll")).GetManifestResourceStream($@"{ResourceAssembly}.Resources.{name}");
} }