DirectorySeparator issue when black or forward slash.
Tested on Apple mac and Windows
This commit is contained in:
parent
22830a2cc1
commit
c6e2c2e501
|
@ -7,6 +7,7 @@
|
|||
@inject ISettingService SettingService
|
||||
@inject IStringLocalizer<Index> Localizer
|
||||
@using System.Text.RegularExpressions
|
||||
@using System.IO;
|
||||
|
||||
@if (string.IsNullOrEmpty(_moduledefinitionname))
|
||||
{
|
||||
|
@ -171,14 +172,18 @@ else
|
|||
Dictionary<string, string> systeminfo = await SystemService.GetSystemInfoAsync();
|
||||
if (systeminfo != null)
|
||||
{
|
||||
string[] path = systeminfo["serverpath"].Split('\\');
|
||||
string[] path = systeminfo["serverpath"].Split(Path.DirectorySeparatorChar);
|
||||
if (_template == "internal")
|
||||
{
|
||||
_location = string.Join("\\", path, 0, path.Length - 1) + "\\Oqtane.Client\\Modules\\" + _owner + "." + _module;
|
||||
_location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 1) +
|
||||
Path.DirectorySeparatorChar + "Oqtane.Client" +
|
||||
Path.DirectorySeparatorChar + "Modules" +
|
||||
Path.DirectorySeparatorChar + _owner + "." + _module;
|
||||
}
|
||||
else
|
||||
{
|
||||
_location = string.Join("\\", path, 0, path.Length - 2) + "\\" + _owner + "." + _module;
|
||||
_location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 2) +
|
||||
Path.DirectorySeparatorChar + _owner + "." + _module;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
|
@ -37,11 +37,11 @@ namespace Oqtane.Services
|
|||
{
|
||||
if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar)))
|
||||
{
|
||||
folderPath = Utilities.PathCombine(folderPath,"\\");
|
||||
folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString());
|
||||
}
|
||||
|
||||
|
||||
var path = WebUtility.UrlEncode(folderPath);
|
||||
|
||||
|
||||
return await GetJsonAsync<List<File>>($"{Apiurl}/{siteId}/{path}");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Oqtane.Models;
|
||||
using Oqtane.Models;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
|
@ -37,11 +37,11 @@ namespace Oqtane.Services
|
|||
{
|
||||
if (!(folderPath.EndsWith(System.IO.Path.DirectorySeparatorChar) || folderPath.EndsWith(System.IO.Path.AltDirectorySeparatorChar)))
|
||||
{
|
||||
folderPath = Utilities.PathCombine(folderPath, "\\");
|
||||
folderPath = Utilities.PathCombine(folderPath, System.IO.Path.DirectorySeparatorChar.ToString());
|
||||
}
|
||||
|
||||
|
||||
var path = WebUtility.UrlEncode(folderPath);
|
||||
|
||||
|
||||
return await GetJsonAsync<Folder>($"{ApiUrl}/{siteId}/{path}");
|
||||
}
|
||||
|
||||
|
|
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue
Block a user