From bc08434a9df75a270e746ffde3e47b246303c93b Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 23 Nov 2022 20:51:15 +0200 Subject: [PATCH 1/5] Improved logging and stop the Renamedlls task if recompression fails. --- .../BlazorHostedSampleApp/.dockerignore | 25 ++++++++ .../BlazorHostedSampleApp.Client.csproj | 2 +- .../BlazorHostedSampleApp.Server.csproj | 3 + .../BlazorHostedSampleApp/Server/Dockerfile | 24 ++++++++ .../Server/Properties/launchSettings.json | 57 +++++++++++-------- .../RenameDlls.cs | 30 ++++++++-- .../BlazorWasmAntivirusProtection.csproj | 2 +- 7 files changed, 110 insertions(+), 33 deletions(-) create mode 100644 sampleapps/BlazorHostedSampleApp/.dockerignore create mode 100644 sampleapps/BlazorHostedSampleApp/Server/Dockerfile diff --git a/sampleapps/BlazorHostedSampleApp/.dockerignore b/sampleapps/BlazorHostedSampleApp/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/sampleapps/BlazorHostedSampleApp/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj index 183e33f..bacdfb1 100644 --- a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj +++ b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj @@ -21,7 +21,7 @@ - + diff --git a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj index c313d4b..0b1c37a 100644 --- a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj +++ b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj @@ -8,6 +8,8 @@ $(RestoreAdditionalProjectSources); $(MSBuildThisFileDirectory)../../../artifacts/nuget + ab18ecad-eb5a-4dc2-bcd9-12a62054d7f0 + Linux @@ -15,6 +17,7 @@ + diff --git a/sampleapps/BlazorHostedSampleApp/Server/Dockerfile b/sampleapps/BlazorHostedSampleApp/Server/Dockerfile new file mode 100644 index 0000000..77045d2 --- /dev/null +++ b/sampleapps/BlazorHostedSampleApp/Server/Dockerfile @@ -0,0 +1,24 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +WORKDIR /src +COPY ["Server/BlazorHostedSampleApp.Server.csproj", "Server/"] +COPY ["Client/BlazorHostedSampleApp.Client.csproj", "Client/"] +COPY ["Shared/BlazorHostedSampleApp.Shared.csproj", "Shared/"] +RUN dotnet restore "Server/BlazorHostedSampleApp.Server.csproj" +COPY . . +WORKDIR "/src/Server" +RUN dotnet build "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "BlazorHostedSampleApp.Server.dll"] \ No newline at end of file diff --git a/sampleapps/BlazorHostedSampleApp/Server/Properties/launchSettings.json b/sampleapps/BlazorHostedSampleApp/Server/Properties/launchSettings.json index e0f8a5c..1b1e8a7 100644 --- a/sampleapps/BlazorHostedSampleApp/Server/Properties/launchSettings.json +++ b/sampleapps/BlazorHostedSampleApp/Server/Properties/launchSettings.json @@ -1,30 +1,37 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:55913", - "sslPort": 44338 - } + "profiles": { + "BlazorHostedSampleApp.Server": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:7107;http://localhost:5266" }, - "profiles": { - "BlazorHostedSampleApp.Server": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:7107;http://localhost:5266", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55913", + "sslPort": 44338 } } +} \ No newline at end of file diff --git a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs index dd1db3e..fc13c11 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs +++ b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs @@ -81,12 +81,18 @@ public override bool Execute() if (File.Exists(bootJsonGzPath) && BlazorEnableCompression) { Log.LogMessage(MessageImportance.High, $"BlazorWasmAntivirusProtection: Recompressing \"{bootJsonGzPath}\""); - GZipCompress(bootJsonPath, bootJsonGzPath); + if(!GZipCompress(bootJsonPath, bootJsonGzPath)) + { + return false; + } } if (File.Exists(bootJsonBrPath) && BlazorEnableCompression) { Log.LogMessage(MessageImportance.High, $"BlazorWasmAntivirusProtection: Recompressing \"{bootJsonBrPath}\""); - BrotliCompress(bootJsonPath, bootJsonBrPath); + if(!BrotliCompress(bootJsonPath, bootJsonBrPath)) + { + return false; + } } } @@ -95,7 +101,7 @@ public override bool Execute() return true; } - private void GZipCompress(string bootJsonPath, string bootJsonGzPath) + private bool GZipCompress(string bootJsonPath, string bootJsonGzPath) { try { @@ -107,11 +113,17 @@ private void GZipCompress(string bootJsonPath, string bootJsonGzPath) } catch (Exception ex) { - Log.LogErrorFromException(ex); + if (File.Exists(bootJsonGzPath)) + { + File.Delete(bootJsonGzPath); + } + Log.LogErrorFromException(ex, true, true, null); + return false; } + return true; } - private void BrotliCompress(string bootJsonPath, string bootJsonBrPath) + private bool BrotliCompress(string bootJsonPath, string bootJsonBrPath) { try { @@ -128,8 +140,14 @@ private void BrotliCompress(string bootJsonPath, string bootJsonBrPath) } catch (Exception ex) { - Log.LogErrorFromException(ex); + if (File.Exists(bootJsonBrPath)) + { + File.Delete(bootJsonBrPath); + } + Log.LogErrorFromException(ex, true, true, null); + return false; } + return true; } string ComputeSha256Hash(string rawData) diff --git a/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj b/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj index c4a31f3..1917960 100644 --- a/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj +++ b/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj @@ -11,7 +11,7 @@ https://github.com/stavroskasidis/BlazorWasmAntivirusProtection This package attempts to guard against false positives from antiviruses that flag Blazor Wasm as malware $(VersionSuffix) - 2.2.1 + 2.2.2 $(Version)-$(VersionSuffix) From 09af48329b651bba1ed91f57bd61dae7f3853346 Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 23 Nov 2022 22:18:53 +0200 Subject: [PATCH 2/5] Removed Brotli.NET that depends on native libs and added BrotliCompress tool that uses .net native brotli compression. --- README.md | 9 ++++++- .../BlazorHostedSampleApp.Client.csproj | 2 +- .../BlazorHostedSampleApp.Server.csproj | 2 +- .../BlazorHostedSampleApp/Server/Dockerfile | 1 + ...mAntivirusProtection.BrotliCompress.csproj | 10 ++++++++ .../Program.cs | 21 ++++++++++++++++ ...BlazorWasmAntivirusProtection.Tasks.csproj | 1 - .../RenameDlls.cs | 25 +++++++++++-------- src/BlazorWasmAntivirusProtection.sln | 14 ++++++++--- .../BlazorWasmAntivirusProtection.csproj | 16 +++++++++++- .../BlazorWasmAntivirusProtection.targets | 6 ++++- 11 files changed, 87 insertions(+), 20 deletions(-) create mode 100644 src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj create mode 100644 src/BlazorWasmAntivirusProtection.BrotliCompress/Program.cs diff --git a/README.md b/README.md index 6fc77f7..3d34342 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,14 @@ This work was inspired by the post in https://github.com/dotnet/aspnetcore/issue ## Release Notes -
2.2.0 +
2.3.0 + +>- Removed Brotli.NET that depends on native libs and added BrotliCompress tool that uses .net native brotli compression. + Fixes [#36](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/36), [#42](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/42) + (Contribution by [jsakamoto](https://github.com/jsakamoto)) +
+ +
2.2.0 >- Fix when publishing from Visual Studio [#36](https://github.com/stavroskasidis/BlazorWasmAntivirusProtection/issues/36)
diff --git a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj index bacdfb1..4dac894 100644 --- a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj +++ b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj @@ -18,7 +18,7 @@ - + diff --git a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj index 0b1c37a..4930a72 100644 --- a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj +++ b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj @@ -16,7 +16,7 @@ - + diff --git a/sampleapps/BlazorHostedSampleApp/Server/Dockerfile b/sampleapps/BlazorHostedSampleApp/Server/Dockerfile index 77045d2..fc023ff 100644 --- a/sampleapps/BlazorHostedSampleApp/Server/Dockerfile +++ b/sampleapps/BlazorHostedSampleApp/Server/Dockerfile @@ -16,6 +16,7 @@ WORKDIR "/src/Server" RUN dotnet build "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/build FROM build AS publish +RUN apt-get update && apt-get install -y libc6-dev RUN dotnet publish "BlazorHostedSampleApp.Server.csproj" -c Release -o /app/publish /p:UseAppHost=false FROM base AS final diff --git a/src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj b/src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj new file mode 100644 index 0000000..0881506 --- /dev/null +++ b/src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + + \ No newline at end of file diff --git a/src/BlazorWasmAntivirusProtection.BrotliCompress/Program.cs b/src/BlazorWasmAntivirusProtection.BrotliCompress/Program.cs new file mode 100644 index 0000000..facdb6a --- /dev/null +++ b/src/BlazorWasmAntivirusProtection.BrotliCompress/Program.cs @@ -0,0 +1,21 @@ +using System.IO.Compression; + +try +{ + var bootJsonPath = args[0]; + var bootJsonBrPath = args[1]; + var compressionLeveText = args[2]; + + File.Delete(bootJsonBrPath); + var compressionLevel = Enum.TryParse(compressionLeveText, out var level) ? level : CompressionLevel.Optimal; + using var fileStream = File.OpenRead(bootJsonPath); + using var stream = File.Create(bootJsonBrPath); + using var destination = new BrotliStream(stream, compressionLevel); + fileStream.CopyTo(destination); + return 0; +} +catch (Exception ex) +{ + Console.Error.WriteLine(ex.ToString()); + return 1; +} \ No newline at end of file diff --git a/src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj b/src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj index 7dc5e07..db247b5 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj +++ b/src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj @@ -6,7 +6,6 @@ - diff --git a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs index fc13c11..1663709 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs +++ b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs @@ -1,6 +1,5 @@ namespace BlazorWasmAntivirusProtection.Tasks { - using Brotli; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System; @@ -17,6 +16,8 @@ public class RenameDlls : Task { [Required] public string PublishDir { get; set; } + [Required] + public string BrotliCompressToolPath { get; set; } public string RenameDllsTo { get; set; } = "bin"; public bool DisableRenamingDlls { get; set; } @@ -127,16 +128,20 @@ private bool BrotliCompress(string bootJsonPath, string bootJsonBrPath) { try { - File.Delete(bootJsonBrPath); - var compressionLevel = Enum.TryParse(CompressionLevel, out var level) ? level : System.IO.Compression.CompressionLevel.Optimal; - using var fileStream = File.OpenRead(bootJsonPath); - using var stream = File.Create(bootJsonBrPath); - fileStream.CompressToBrotli(stream, compressionLevel switch + // NOTE: This MSBuild Custom Task will run not only on .NET 6 or later but also on .NET Framework 4.x. + // Therefore the `BrotliStream` class is not usable in this MSBuild Custom Task due to + // the `BrotliStream` class is not provided on.NET Framework.Instead, we can do that + // with execution as an out process. + var startInfo = new ProcessStartInfo { - System.IO.Compression.CompressionLevel.Optimal => 11, - System.IO.Compression.CompressionLevel.Fastest => 5, - System.IO.Compression.CompressionLevel.NoCompression=> 0, - }); + FileName = "dotnet", + Arguments = $"exec \"{BrotliCompressToolPath}\" \"{bootJsonPath}\" \"{bootJsonBrPath}\" \"{CompressionLevel}\"" + }; + Log.LogMessage(MessageImportance.Low, $"{startInfo.FileName} {startInfo.Arguments}"); + var process = Process.Start(startInfo); + process.WaitForExit(); + if (process.ExitCode != 0) + throw new Exception($"The exit code of recompressing with Brotli command was not 0. (it was {process.ExitCode})"); } catch (Exception ex) { diff --git a/src/BlazorWasmAntivirusProtection.sln b/src/BlazorWasmAntivirusProtection.sln index c947400..116c1ac 100644 --- a/src/BlazorWasmAntivirusProtection.sln +++ b/src/BlazorWasmAntivirusProtection.sln @@ -36,15 +36,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "configs", "configs", "{298E ..\README.md = ..\README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHostedSampleLazyLoading.Server", "..\sampleapps\BlazorHostedSampleLazyLoading\Server\BlazorHostedSampleLazyLoading.Server.csproj", "{9E4C4D90-0E4C-4679-AD28-7F990B286344}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorHostedSampleLazyLoading.Server", "..\sampleapps\BlazorHostedSampleLazyLoading\Server\BlazorHostedSampleLazyLoading.Server.csproj", "{9E4C4D90-0E4C-4679-AD28-7F990B286344}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHostedSampleLazyLoading.Client", "..\sampleapps\BlazorHostedSampleLazyLoading\Client\BlazorHostedSampleLazyLoading.Client.csproj", "{ABC6E5FE-4B5E-42AC-A955-35754B2805A7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorHostedSampleLazyLoading.Client", "..\sampleapps\BlazorHostedSampleLazyLoading\Client\BlazorHostedSampleLazyLoading.Client.csproj", "{ABC6E5FE-4B5E-42AC-A955-35754B2805A7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHostedSampleLazyLoading.Shared", "..\sampleapps\BlazorHostedSampleLazyLoading\Shared\BlazorHostedSampleLazyLoading.Shared.csproj", "{4C7F227E-2E90-4D0B-960D-0247DA937117}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorHostedSampleLazyLoading.Shared", "..\sampleapps\BlazorHostedSampleLazyLoading\Shared\BlazorHostedSampleLazyLoading.Shared.csproj", "{4C7F227E-2E90-4D0B-960D-0247DA937117}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorHostedSampleLazyLoading", "BlazorHostedSampleLazyLoading", "{B8531AC8-E394-4875-AB1F-3167F4C7149C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorHostedSampleLazyLoading.Counter", "..\sampleapps\BlazorHostedSampleLazyLoading\BlazorHostedSampleLazyLoading.Counter\BlazorHostedSampleLazyLoading.Counter.csproj", "{D1EC6118-9D76-42C1-9F4B-E9819AEC6472}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorHostedSampleLazyLoading.Counter", "..\sampleapps\BlazorHostedSampleLazyLoading\BlazorHostedSampleLazyLoading.Counter\BlazorHostedSampleLazyLoading.Counter.csproj", "{D1EC6118-9D76-42C1-9F4B-E9819AEC6472}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWasmAntivirusProtection.BrotliCompress", "BlazorWasmAntivirusProtection.BrotliCompress\BlazorWasmAntivirusProtection.BrotliCompress.csproj", "{DF24E023-EE53-4C3A-B0A2-927CCD39F2AF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -100,6 +102,10 @@ Global {D1EC6118-9D76-42C1-9F4B-E9819AEC6472}.Debug|Any CPU.Build.0 = Debug|Any CPU {D1EC6118-9D76-42C1-9F4B-E9819AEC6472}.Release|Any CPU.ActiveCfg = Release|Any CPU {D1EC6118-9D76-42C1-9F4B-E9819AEC6472}.Release|Any CPU.Build.0 = Release|Any CPU + {DF24E023-EE53-4C3A-B0A2-927CCD39F2AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF24E023-EE53-4C3A-B0A2-927CCD39F2AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF24E023-EE53-4C3A-B0A2-927CCD39F2AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF24E023-EE53-4C3A-B0A2-927CCD39F2AF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj b/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj index 1917960..06bef72 100644 --- a/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj +++ b/src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj @@ -11,7 +11,7 @@ https://github.com/stavroskasidis/BlazorWasmAntivirusProtection This package attempts to guard against false positives from antiviruses that flag Blazor Wasm as malware $(VersionSuffix) - 2.2.2 + 2.3.0 $(Version)-$(VersionSuffix) @@ -31,5 +31,19 @@ + + + + + + + + + diff --git a/src/BlazorWasmAntivirusProtection/build/net7.0/BlazorWasmAntivirusProtection.targets b/src/BlazorWasmAntivirusProtection/build/net7.0/BlazorWasmAntivirusProtection.targets index 0808dec..51a5baa 100644 --- a/src/BlazorWasmAntivirusProtection/build/net7.0/BlazorWasmAntivirusProtection.targets +++ b/src/BlazorWasmAntivirusProtection/build/net7.0/BlazorWasmAntivirusProtection.targets @@ -8,6 +8,7 @@ $(ComputeBlazorExtensionsDependsOn);_ObfuscateDlls + <_BlazorWAPBrotliCompressDll>$(MSBuildThisFileDirectory)..\..\tools\BlazorWasmAntivirusProtection.BrotliCompress.dll @@ -33,7 +34,10 @@ - + + \ No newline at end of file From baddc8ec1e56af31883b4000440cf32e20b5c4c1 Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 23 Nov 2022 22:22:59 +0200 Subject: [PATCH 3/5] ci fix --- scripts/build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index e8ca30d..9a295e4 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -37,6 +37,7 @@ Write-Host "Version suffix: $VersionSuffix" Write-Message "Building ..." dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Release +dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Release /p:VersionSuffix="$VersionSuffix" Confirm-PreviousCommand From 9dc2fdd48e4291d47e232f56a0674883a40b4892 Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 23 Nov 2022 22:31:34 +0200 Subject: [PATCH 4/5] Updated hosted apps to use a Directory.Build.props --- .../Client/BlazorHostedSampleApp.Client.csproj | 7 +++---- .../Server/BlazorHostedSampleApp.Server.csproj | 5 ++--- .../Shared/BlazorHostedSampleApp.Shared.csproj | 1 - .../BlazorHostedSampleLazyLoading.Counter.csproj | 3 +-- .../Client/BlazorHostedSampleLazyLoading.Client.csproj | 7 +++---- .../Server/BlazorHostedSampleLazyLoading.Server.csproj | 5 ++--- .../Shared/BlazorHostedSampleLazyLoading.Shared.csproj | 1 - .../Client/BlazorHostedSamplePwa.Client.csproj | 7 +++---- .../Server/BlazorHostedSamplePwa.Server.csproj | 5 ++--- .../Shared/BlazorHostedSamplePwa.Shared.csproj | 1 - sampleapps/Directory.Build.props | 8 ++++++++ 11 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 sampleapps/Directory.Build.props diff --git a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj index 4dac894..e21eb4a 100644 --- a/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj +++ b/sampleapps/BlazorHostedSampleApp/Client/BlazorHostedSampleApp.Client.csproj @@ -1,7 +1,6 @@  - net7.0 enable enable @@ -16,9 +15,9 @@ - - - + + + diff --git a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj index 4930a72..4a42649 100644 --- a/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj +++ b/sampleapps/BlazorHostedSampleApp/Server/BlazorHostedSampleApp.Server.csproj @@ -1,7 +1,6 @@  - net7.0 enable enable @@ -15,8 +14,8 @@ - - + + diff --git a/sampleapps/BlazorHostedSampleApp/Shared/BlazorHostedSampleApp.Shared.csproj b/sampleapps/BlazorHostedSampleApp/Shared/BlazorHostedSampleApp.Shared.csproj index ed01ce0..eb3b802 100644 --- a/sampleapps/BlazorHostedSampleApp/Shared/BlazorHostedSampleApp.Shared.csproj +++ b/sampleapps/BlazorHostedSampleApp/Shared/BlazorHostedSampleApp.Shared.csproj @@ -1,7 +1,6 @@ - net7.0 enable enable diff --git a/sampleapps/BlazorHostedSampleLazyLoading/BlazorHostedSampleLazyLoading.Counter/BlazorHostedSampleLazyLoading.Counter.csproj b/sampleapps/BlazorHostedSampleLazyLoading/BlazorHostedSampleLazyLoading.Counter/BlazorHostedSampleLazyLoading.Counter.csproj index 3c48a8b..08724f7 100644 --- a/sampleapps/BlazorHostedSampleLazyLoading/BlazorHostedSampleLazyLoading.Counter/BlazorHostedSampleLazyLoading.Counter.csproj +++ b/sampleapps/BlazorHostedSampleLazyLoading/BlazorHostedSampleLazyLoading.Counter/BlazorHostedSampleLazyLoading.Counter.csproj @@ -1,7 +1,6 @@ - net7.0 enable enable @@ -12,7 +11,7 @@ - + diff --git a/sampleapps/BlazorHostedSampleLazyLoading/Client/BlazorHostedSampleLazyLoading.Client.csproj b/sampleapps/BlazorHostedSampleLazyLoading/Client/BlazorHostedSampleLazyLoading.Client.csproj index 1c5c5be..bf6fdaf 100644 --- a/sampleapps/BlazorHostedSampleLazyLoading/Client/BlazorHostedSampleLazyLoading.Client.csproj +++ b/sampleapps/BlazorHostedSampleLazyLoading/Client/BlazorHostedSampleLazyLoading.Client.csproj @@ -1,7 +1,6 @@  - net7.0 enable enable @@ -11,9 +10,9 @@ - - - + + + diff --git a/sampleapps/BlazorHostedSampleLazyLoading/Server/BlazorHostedSampleLazyLoading.Server.csproj b/sampleapps/BlazorHostedSampleLazyLoading/Server/BlazorHostedSampleLazyLoading.Server.csproj index 228a5ab..72469af 100644 --- a/sampleapps/BlazorHostedSampleLazyLoading/Server/BlazorHostedSampleLazyLoading.Server.csproj +++ b/sampleapps/BlazorHostedSampleLazyLoading/Server/BlazorHostedSampleLazyLoading.Server.csproj @@ -1,15 +1,14 @@  - net7.0 enable enable - - + + diff --git a/sampleapps/BlazorHostedSampleLazyLoading/Shared/BlazorHostedSampleLazyLoading.Shared.csproj b/sampleapps/BlazorHostedSampleLazyLoading/Shared/BlazorHostedSampleLazyLoading.Shared.csproj index 3c56617..04a80b2 100644 --- a/sampleapps/BlazorHostedSampleLazyLoading/Shared/BlazorHostedSampleLazyLoading.Shared.csproj +++ b/sampleapps/BlazorHostedSampleLazyLoading/Shared/BlazorHostedSampleLazyLoading.Shared.csproj @@ -1,7 +1,6 @@ - net7.0 enable enable diff --git a/sampleapps/BlazorHostedSamplePwa/Client/BlazorHostedSamplePwa.Client.csproj b/sampleapps/BlazorHostedSamplePwa/Client/BlazorHostedSamplePwa.Client.csproj index 20f221c..ab5cf85 100644 --- a/sampleapps/BlazorHostedSamplePwa/Client/BlazorHostedSamplePwa.Client.csproj +++ b/sampleapps/BlazorHostedSamplePwa/Client/BlazorHostedSamplePwa.Client.csproj @@ -1,7 +1,6 @@  - net7.0 enable enable @@ -12,9 +11,9 @@ - - - + + + diff --git a/sampleapps/BlazorHostedSamplePwa/Server/BlazorHostedSamplePwa.Server.csproj b/sampleapps/BlazorHostedSamplePwa/Server/BlazorHostedSamplePwa.Server.csproj index 6e6bf4c..a0b65cb 100644 --- a/sampleapps/BlazorHostedSamplePwa/Server/BlazorHostedSamplePwa.Server.csproj +++ b/sampleapps/BlazorHostedSamplePwa/Server/BlazorHostedSamplePwa.Server.csproj @@ -1,7 +1,6 @@  - net7.0 enable enable @@ -11,8 +10,8 @@ - - + + diff --git a/sampleapps/BlazorHostedSamplePwa/Shared/BlazorHostedSamplePwa.Shared.csproj b/sampleapps/BlazorHostedSamplePwa/Shared/BlazorHostedSamplePwa.Shared.csproj index 3c56617..04a80b2 100644 --- a/sampleapps/BlazorHostedSamplePwa/Shared/BlazorHostedSamplePwa.Shared.csproj +++ b/sampleapps/BlazorHostedSamplePwa/Shared/BlazorHostedSamplePwa.Shared.csproj @@ -1,7 +1,6 @@ - net7.0 enable enable diff --git a/sampleapps/Directory.Build.props b/sampleapps/Directory.Build.props new file mode 100644 index 0000000..2baa92a --- /dev/null +++ b/sampleapps/Directory.Build.props @@ -0,0 +1,8 @@ + + + net7.0 + 7.0.* + 2.3.0-test + + + \ No newline at end of file From 441190b482b8974fbfe6c2393ba546b04211f3f3 Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 23 Nov 2022 23:07:08 +0200 Subject: [PATCH 5/5] Sample apps ci fix --- scripts/build-sample-apps.ps1 | 1 + scripts/debug.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/build-sample-apps.ps1 b/scripts/build-sample-apps.ps1 index 447fe42..04f5bff 100644 --- a/scripts/build-sample-apps.ps1 +++ b/scripts/build-sample-apps.ps1 @@ -30,6 +30,7 @@ function Confirm-Process { Write-Message "Building package test version..." dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Release +dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Release /p:VersionSuffix="test" Confirm-PreviousCommand diff --git a/scripts/debug.ps1 b/scripts/debug.ps1 index 6a24c56..a3ccadd 100644 --- a/scripts/debug.ps1 +++ b/scripts/debug.ps1 @@ -37,6 +37,7 @@ Get-Process "dotnet" | Stop-Process Write-Message "Building ..." dotnet build ../src/BlazorWasmAntivirusProtection.Tasks/BlazorWasmAntivirusProtection.Tasks.csproj -c Debug +dotnet build ../src/BlazorWasmAntivirusProtection.BrotliCompress/BlazorWasmAntivirusProtection.BrotliCompress.csproj -c Release dotnet build ../src/BlazorWasmAntivirusProtection/BlazorWasmAntivirusProtection.csproj -c Debug /p:VersionSuffix="test" Confirm-PreviousCommand