From 786c35fa03ad5184903052c587ab4c3e33aad150 Mon Sep 17 00:00:00 2001 From: Gene Date: Mon, 26 Dec 2022 04:47:37 +0100 Subject: [PATCH] Fixed wrong SharpZipLib package version for net472 build. --- MIG.HomeAutomation/MIG.HomeAutomation.csproj | 4 ++++ MIG.HomeAutomation/ZWave/Pepper1Db.cs | 5 +++++ MIG.HomeAutomation/nuget_pack.ps1 | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/MIG.HomeAutomation/MIG.HomeAutomation.csproj b/MIG.HomeAutomation/MIG.HomeAutomation.csproj index c3a3dca..4d64941 100644 --- a/MIG.HomeAutomation/MIG.HomeAutomation.csproj +++ b/MIG.HomeAutomation/MIG.HomeAutomation.csproj @@ -13,6 +13,10 @@ net472;net6.0 + + + + diff --git a/MIG.HomeAutomation/ZWave/Pepper1Db.cs b/MIG.HomeAutomation/ZWave/Pepper1Db.cs index f62358e..3d34c0a 100644 --- a/MIG.HomeAutomation/ZWave/Pepper1Db.cs +++ b/MIG.HomeAutomation/ZWave/Pepper1Db.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Net; +using System.Text; using System.Xml.Linq; using System.Xml.XPath; using ICSharpCode.SharpZipLib.Core; @@ -149,7 +150,11 @@ private static void ExtractZipFile(string archiveFilenameIn, string password, st { FileStream fs = File.OpenRead(archiveFilenameIn); zf = new ZipFile(fs); +#if !NETCOREAPP + ZipStrings.CodePage = Encoding.UTF8.CodePage; +#else zf.StringCodec = StringCodec.FromCodePage(System.Text.Encoding.UTF8.CodePage); +#endif if (!String.IsNullOrEmpty(password)) { zf.Password = password; // AES encrypted entries are handled automatically diff --git a/MIG.HomeAutomation/nuget_pack.ps1 b/MIG.HomeAutomation/nuget_pack.ps1 index ec72532..3d39ad3 100644 --- a/MIG.HomeAutomation/nuget_pack.ps1 +++ b/MIG.HomeAutomation/nuget_pack.ps1 @@ -11,7 +11,7 @@ if (-not ([string]::IsNullOrEmpty($versionStr))) { $content | Out-File $root\$project\$project.csproj - & dotnet pack $root\$project -o . + & dotnet pack -c release $root\$project -o . } else { Write-Host "Version string is empty, possibly dry run or APPVEYOR_REPO_TAG_NAME environment variable is not set"