From 060c34d273608cfda7a3d103db780388aec92968 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 3 Apr 2020 12:54:29 +0100 Subject: [PATCH 1/8] Upgrade to .Net 5 Preview2 --- .devcontainer/Dockerfile | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c94b049a896..a004c50f1cf 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM mcr.microsoft.com/dotnet/core/sdk:5.0.0-preview.1.20120.5 +FROM mcr.microsoft.com/dotnet/core/sdk:5.0.100-preview.2 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/global.json b/global.json index 8696bf07ded..ee1e3d9321f 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.1.20155.7" + "version": "5.0.100-preview.2.20176.6" } } From 138ddab6007c5322b21366d02e60efdeb265edcd Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 3 Apr 2020 13:14:09 +0100 Subject: [PATCH 2/8] Update files.wxs by using file produced by Start-PSPackage --- assets/files.wxs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 72f696336be..4a8bb67b80e 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -403,9 +403,6 @@ - - - @@ -3089,15 +3086,18 @@ - - - + + + + + + @@ -3235,7 +3235,6 @@ - @@ -4077,7 +4076,6 @@ - @@ -4096,6 +4094,8 @@ + + From a1bbedca6701aeb474574b964b100efead937d9f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 3 Apr 2020 13:21:38 +0100 Subject: [PATCH 3/8] trigger From 0ae6b3df21d0db1a550ccbb83aa407d91c21de0f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 3 Apr 2020 14:05:11 +0100 Subject: [PATCH 4/8] files.wxs needed updating again with the icons somehow (done via output of Start-PSPacakge again) --- assets/files.wxs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/assets/files.wxs b/assets/files.wxs index 4a8bb67b80e..677673cba00 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1957,6 +1957,18 @@ + + + + + + + + + + + + @@ -4096,6 +4108,10 @@ + + + + From 4d581c6a85f4af20d72437f00e4bfa847b358222 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 7 Apr 2020 14:20:15 +0100 Subject: [PATCH 5/8] Upgrade NuGet packages to preview.2 --- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 6 +++--- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/WebListener/WebListener.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index aafcb94a14f..503b7c7c984 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 52023d78fb0..ad2ea2a2b51 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 44e6378fb23..c2d8cfbd0ad 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 2401ed3bc85..d4ad1f36292 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index da504fc8563..46fc389e1a4 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index fd612866b5a..64cca263c93 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index f26bdcb1830..63c36611f72 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 940128ce0a8..fa6a947bc1e 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 00a4d777c4d..542f33a7477 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 283cf97fc9121471120da06f24d5e609d0c9663c Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 7 Apr 2020 15:20:15 +0100 Subject: [PATCH 6/8] Revert "files.wxs needed updating again with the icons somehow (done via output of Start-PSPacakge again)" This reverts commit 0ae6b3df21d0db1a550ccbb83aa407d91c21de0f. --- assets/files.wxs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 677673cba00..4a8bb67b80e 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1957,18 +1957,6 @@ - - - - - - - - - - - - @@ -4108,10 +4096,6 @@ - - - - From 32c72d6a5c3199ac84802e26604b88f15105e8cc Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Tue, 7 Apr 2020 18:16:23 +0100 Subject: [PATCH 7/8] Fix Send-MailMessage failures by disposing of SMTP client in Endprocessing in a finally block and include another disposal in there as well. --- .../commands/utility/Send-MailMessage.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs index b4582f788a8..4032a558130 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs @@ -374,9 +374,12 @@ protected override void EndProcessing() ErrorRecord er = new ErrorRecord(ex, "AuthenticationException", ErrorCategory.InvalidOperation, _mSmtpClient); WriteError(er); } - - // If we don't dispose the attachments, the sender can't modify or use the files sent. - _mMailMessage.Attachments.Dispose(); + finally + { + _mSmtpClient.Dispose(); + // If we don't dispose the attachments, the sender can't modify or use the files sent. + _mMailMessage.Attachments.Dispose(); + } } #endregion From 426df1f39f38d6d8f78cfd6dc8c9981ee46c66e2 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 7 Apr 2020 20:13:18 +0100 Subject: [PATCH 8/8] Fix CodeFactor issue by inserting newline before comment --- .../commands/utility/Send-MailMessage.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs index 4032a558130..25da2e8025f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs @@ -377,6 +377,7 @@ protected override void EndProcessing() finally { _mSmtpClient.Dispose(); + // If we don't dispose the attachments, the sender can't modify or use the files sent. _mMailMessage.Attachments.Dispose(); }