diff --git a/common.props b/common.props index bf99a29ca2..68d68b5d30 100644 --- a/common.props +++ b/common.props @@ -18,6 +18,11 @@ + + + + + all diff --git a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/DictionaryBasedFileProvider.cs b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/DictionaryBasedFileProvider.cs index 63c2b0bc03..5146cddeeb 100644 --- a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/DictionaryBasedFileProvider.cs +++ b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/DictionaryBasedFileProvider.cs @@ -16,7 +16,7 @@ public abstract class DictionaryBasedFileProvider : IFileProvider return new NotFoundFileInfo(subpath!); } - var file = Files.GetOrDefault(NormalizePath(subpath)) ?? Files.GetOrDefault(subpath); + var file = Files.GetOrDefault(NormalizePath(subpath)) if (file == null) { diff --git a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/AbpEmbeddedFileProvider.cs b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/AbpEmbeddedFileProvider.cs index 44e757beab..9ea816e0eb 100644 --- a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/AbpEmbeddedFileProvider.cs +++ b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/AbpEmbeddedFileProvider.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using System.Text.RegularExpressions; using JetBrains.Annotations; using Microsoft.Extensions.FileProviders; @@ -47,8 +46,6 @@ public class AbpEmbeddedFileProvider : DictionaryBasedFileProvider var fullPath = ConvertToRelativePath(resourcePath).EnsureStartsWith('/'); - fullPath = fullPath.Replace("client_proxies", "client-proxies"); - if (fullPath.Contains("/")) { AddDirectoriesRecursively(files, fullPath.Substring(0, fullPath.LastIndexOf('/')), lastModificationTime); @@ -110,21 +107,6 @@ public class AbpEmbeddedFileProvider : DictionaryBasedFileProvider { resourceName = resourceName.Substring(BaseNamespace!.Length + 1); } - else - { - // Fix NET 10 RC 1 Microsoft.Extensions.FileProviders.Embedded issue temporarily - //https://github.com/dotnet/aspnetcore/issues/63719 - string[] webContentFolders = ["wwwroot", "Pages", "Views", "Themes", "Components"]; - foreach (var contentFolder in webContentFolders.Where(contentFolder => resourceName.Contains($".{contentFolder}."))) - { - var index = resourceName.IndexOf(contentFolder, StringComparison.CurrentCultureIgnoreCase); - if (index > 0) - { - resourceName = resourceName.Substring(index); - } - break; - } - } var pathParts = resourceName.Split('.'); if (pathParts.Length <= 2) @@ -132,35 +114,10 @@ public class AbpEmbeddedFileProvider : DictionaryBasedFileProvider return resourceName; } - if (pathParts.Length >= 4 && (pathParts[pathParts.Length - 2] == "min" || pathParts[pathParts.Length - 2] == "rtl")) - { - // Fix NET 10 RC 1 Microsoft.Extensions.FileProviders.Embedded issue temporarily - //https://github.com/dotnet/aspnetcore/issues/63719 - pathParts = pathParts[pathParts.Length - 3] == "bundle" - ? pathParts.Take(pathParts.Length - 4).Concat([pathParts.Skip(pathParts.Length - 4).JoinAsString(".")]).ToArray() - : pathParts.Take(pathParts.Length - 3).Concat([pathParts.Skip(pathParts.Length - 3).JoinAsString(".")]).ToArray(); - - if (pathParts.Length <= 2) - { - return resourceName; - } - - var folder = pathParts.Take(pathParts.Length - 1).JoinAsString("/").Replace("_", "-"); - var fileName = pathParts[pathParts.Length - 1].Replace("_", "-"); - return folder + "/" + fileName; - } - else - { - if (pathParts.Length <= 2) - { - return resourceName; - } - - var folder = pathParts.Take(pathParts.Length - 2).JoinAsString("/"); - var fileName = pathParts[pathParts.Length - 2] + "." + pathParts[pathParts.Length - 1]; + var folder = pathParts.Take(pathParts.Length - 2).JoinAsString("/"); + var fileName = pathParts[pathParts.Length - 2] + "." + pathParts[pathParts.Length - 1]; - return folder + "/" + fileName; - } + return folder + "/" + fileName; } private static string CalculateFileName(string filePath)