diff --git a/src/BlazorWasmAntivirusProtection.Tasks/RecompressSatelliteAssemblies.cs b/src/BlazorWasmAntivirusProtection.Tasks/RecompressSatelliteAssemblies.cs index 9bc4667..b259e55 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/RecompressSatelliteAssemblies.cs +++ b/src/BlazorWasmAntivirusProtection.Tasks/RecompressSatelliteAssemblies.cs @@ -20,19 +20,23 @@ public class RecompressSatelliteAssemblies : Task public string BrotliCompressToolPath { get; set; } public string CompressionLevel { get; set; } + public string RenameDllsTo { get; set; } = "bin"; + public bool DisableRenamingDlls { get; set; } public override bool Execute() { -//#if DEBUG -// System.Diagnostics.Debugger.Launch(); -//#endif + //#if DEBUG + // System.Diagnostics.Debugger.Launch(); + //#endif + + var assembyFilesExtension = DisableRenamingDlls ? "dll" : RenameDllsTo; Log.LogMessage(MessageImportance.High, $"BlazorWasmAntivirusProtection: Recompressing satellite assemblies"); var frameworkDirs = Directory.GetDirectories(PublishDir, "_framework", SearchOption.AllDirectories); foreach(var frameworkDir in frameworkDirs) { foreach (var file in Directory.GetFiles(frameworkDir, "*.*", SearchOption.AllDirectories)) { - if (file.EndsWith(".resources.bin")) + if (file.EndsWith($".resources.{assembyFilesExtension}")) { var gzFile = $"{file}.gz"; if (File.Exists(gzFile)) diff --git a/src/BlazorWasmAntivirusProtection/build/net6.0/BlazorWasmAntivirusProtection.targets b/src/BlazorWasmAntivirusProtection/build/net6.0/BlazorWasmAntivirusProtection.targets index a5b436a..807a4be 100644 --- a/src/BlazorWasmAntivirusProtection/build/net6.0/BlazorWasmAntivirusProtection.targets +++ b/src/BlazorWasmAntivirusProtection/build/net6.0/BlazorWasmAntivirusProtection.targets @@ -40,7 +40,7 @@ BlazorEnableCompression="$(BlazorEnableCompression)" CompressionLevel="$(_BlazorBrotliCompressionLevel)" BrotliCompressToolPath="$(_BlazorWAPBrotliCompressDll)"> -