From 885877c12b6f7e39b8182cb1eb2e5a744f120738 Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+nxtn@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:03:24 +0800 Subject: [PATCH] Revert "Upgrade to .NET 6 (#806)" (#817) This reverts commit 6db5fbc2c3943cf0f39e5c9780409fa850c121e1. --- eng/build.yml | 20 ++++++++++++-------- src/WinSW.Core/Download.cs | 2 -- src/WinSW.Core/WinSW.Core.csproj | 6 +++--- src/WinSW.Plugins/WinSW.Plugins.csproj | 2 +- src/WinSW.Tests/WinSW.Tests.csproj | 10 +++++----- src/WinSW/WinSW.csproj | 23 +++++++++++++++-------- 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/eng/build.yml b/eng/build.yml index 272ae42..8584685 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -25,12 +25,6 @@ strategy: Release: BuildConfiguration: Release steps: -- task: UseDotNet@2 - displayName: Install .NET SDK - inputs: - packageType: sdk - version: 6.x - includePreviewVersions: true - task: DotNetCoreCLI@2 displayName: Build inputs: @@ -38,8 +32,10 @@ steps: projects: src\WinSW.sln arguments: -c $(BuildConfiguration) -p:Version=$(BuildVersion) - script: | - dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net6.0-windows -r win-x64 -p:Version=$(BuildVersion) - dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net6.0-windows -r win-x86 -p:Version=$(BuildVersion) + dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x64 -p:Version=$(BuildVersion) + dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x86 -p:Version=$(BuildVersion) + dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x64 -p:Version=$(BuildVersion) -p:IncludeNativeLibrariesForSelfExtract=true + dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x86 -p:Version=$(BuildVersion) -p:IncludeNativeLibrariesForSelfExtract=true displayName: Build - task: DotNetCoreCLI@2 displayName: Test @@ -59,6 +55,14 @@ steps: artifact: WinSW-net461.exe_$(BuildConfiguration) displayName: Publish .NET 4.6.1 +- publish: artifacts\publish\WinSW-x64.zip + artifact: WinSW-x64.zip_$(BuildConfiguration) + displayName: Publish .NET x64 .zip + +- publish: artifacts\publish\WinSW-x86.zip + artifact: WinSW-x86.zip_$(BuildConfiguration) + displayName: Publish .NET x86 .zip + - publish: artifacts\publish\WinSW-x64.exe artifact: WinSW-x64.exe_$(BuildConfiguration) displayName: Publish .NET x64 .exe diff --git a/src/WinSW.Core/Download.cs b/src/WinSW.Core/Download.cs index f1eb799..167a1d8 100644 --- a/src/WinSW.Core/Download.cs +++ b/src/WinSW.Core/Download.cs @@ -122,9 +122,7 @@ namespace WinSW /// public async Task PerformAsync() { -#pragma warning disable SYSLIB0014 // Type or member is obsolete var request = WebRequest.Create(this.From); -#pragma warning restore SYSLIB0014 // Type or member is obsolete if (!string.IsNullOrEmpty(this.Proxy)) { var proxyInformation = new CustomProxyInformation(this.Proxy!); diff --git a/src/WinSW.Core/WinSW.Core.csproj b/src/WinSW.Core/WinSW.Core.csproj index 1b28e9e..2ebd139 100644 --- a/src/WinSW.Core/WinSW.Core.csproj +++ b/src/WinSW.Core/WinSW.Core.csproj @@ -1,7 +1,7 @@  - net461;net6.0-windows + net461;net5.0-windows preview enable true @@ -15,13 +15,13 @@ - + - + diff --git a/src/WinSW.Plugins/WinSW.Plugins.csproj b/src/WinSW.Plugins/WinSW.Plugins.csproj index 3fdb8be..9dde121 100644 --- a/src/WinSW.Plugins/WinSW.Plugins.csproj +++ b/src/WinSW.Plugins/WinSW.Plugins.csproj @@ -1,7 +1,7 @@  - net461;net6.0-windows + net461;net5.0-windows latest enable diff --git a/src/WinSW.Tests/WinSW.Tests.csproj b/src/WinSW.Tests/WinSW.Tests.csproj index a1ce104..bfd6318 100644 --- a/src/WinSW.Tests/WinSW.Tests.csproj +++ b/src/WinSW.Tests/WinSW.Tests.csproj @@ -1,7 +1,7 @@  - net471;net6.0-windows + net471;net5.0-windows latest @@ -20,7 +20,7 @@ - + @@ -39,11 +39,11 @@ - - <_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net6.0-windows\WinSW.runtimeconfig*.json" /> + + <_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net5.0-windows\WinSW.runtimeconfig*.json" /> - + <_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net461\System.ValueTuple.dll" /> diff --git a/src/WinSW/WinSW.csproj b/src/WinSW/WinSW.csproj index 0a3ae17..c895380 100644 --- a/src/WinSW/WinSW.csproj +++ b/src/WinSW/WinSW.csproj @@ -2,7 +2,7 @@ Exe - net461;net6.0-windows + net461;net5.0-windows preview enable true @@ -16,11 +16,11 @@ Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors - + true - + 3.0.41 @@ -28,7 +28,7 @@ - + @@ -38,11 +38,18 @@ - + - + + + + + + + + @@ -50,7 +57,7 @@ - + "$(OutDir)$(TargetFileName)" @@ -78,7 +85,7 @@ - +