DirectorySeparator issue when black or forward slash.

Tested on Apple mac and Windows
This commit is contained in:
Leigh Pointer
2021-02-11 15:38:37 +01:00
parent 22830a2cc1
commit c6e2c2e501
4 changed files with 17 additions and 12 deletions

View File

@ -178,7 +178,7 @@ namespace Microsoft.Extensions.DependencyInjection
private static Assembly ResolveDependencies(AssemblyLoadContext context, AssemblyName name)
{
var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + "\\" + name.Name + ".dll";
var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) + Path.DirectorySeparatorChar + name.Name + ".dll";
if (File.Exists(assemblyPath))
{
return context.LoadFromStream(new MemoryStream(File.ReadAllBytes(assemblyPath)));