From d13b635b1711bfe18cdd235baab13ddf780b9cf6 Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+nxtn@users.noreply.github.com> Date: Wed, 17 Mar 2021 00:00:00 +0800 Subject: [PATCH] Upgrade to .NET 6 --- Directory.Build.targets | 2 +- eng/build.yml | 10 ++++++++-- src/WinSW.Core/Download.cs | 2 ++ src/WinSW.Core/WinSW.Core.csproj | 6 +++--- src/WinSW.Plugins/WinSW.Plugins.csproj | 4 ++-- src/WinSW.Tests/WinSW.Tests.csproj | 4 ++-- src/WinSW/WinSW.csproj | 23 +++++++---------------- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index cb2d8e0..93b21a9 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,6 @@  - + VNEXT diff --git a/eng/build.yml b/eng/build.yml index e513673..afeb72d 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -26,6 +26,12 @@ 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: @@ -33,8 +39,8 @@ steps: projects: src\WinSW.sln arguments: -c $(BuildConfiguration) -p:Version=$(BuildVersion) - script: | - dotnet publish -c $(BuildConfiguration) -f net5.0-windows -r win-x64 src\WinSW\WinSW.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion) - dotnet publish -c $(BuildConfiguration) -f net5.0-windows -r win-x86 src\WinSW\WinSW.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(BuildVersion) + dotnet publish -c $(BuildConfiguration) -f net6.0-windows -r win-x64 src\WinSW\WinSW.csproj -p:Version=$(BuildVersion) + dotnet publish -c $(BuildConfiguration) -f net6.0-windows -r win-x86 src\WinSW\WinSW.csproj -p:Version=$(BuildVersion) displayName: Build - script: dotnet test -c $(BuildConfiguration) --collect "XPlat Code Coverage" --no-build src\WinSW.Tests\WinSW.Tests.csproj displayName: Test diff --git a/src/WinSW.Core/Download.cs b/src/WinSW.Core/Download.cs index 3c3db96..4610112 100644 --- a/src/WinSW.Core/Download.cs +++ b/src/WinSW.Core/Download.cs @@ -150,7 +150,9 @@ namespace WinSW public void Perform() #endif { +#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 88f4dbd..a438d2a 100644 --- a/src/WinSW.Core/WinSW.Core.csproj +++ b/src/WinSW.Core/WinSW.Core.csproj @@ -1,7 +1,7 @@  - net20;net40;net461;net5.0-windows + net20;net40;net461;net6.0-windows latest enable true @@ -18,12 +18,12 @@ - + - + diff --git a/src/WinSW.Plugins/WinSW.Plugins.csproj b/src/WinSW.Plugins/WinSW.Plugins.csproj index 69ad08b..3c331a6 100644 --- a/src/WinSW.Plugins/WinSW.Plugins.csproj +++ b/src/WinSW.Plugins/WinSW.Plugins.csproj @@ -1,13 +1,13 @@  - net20;net40;net461;net5.0-windows + net20;net40;net461;net6.0-windows latest enable true - + diff --git a/src/WinSW.Tests/WinSW.Tests.csproj b/src/WinSW.Tests/WinSW.Tests.csproj index 07863a5..bd0ddc5 100644 --- a/src/WinSW.Tests/WinSW.Tests.csproj +++ b/src/WinSW.Tests/WinSW.Tests.csproj @@ -1,7 +1,7 @@  - net40;net461;net5.0-windows + net40;net461;net6.0-windows latest @@ -15,7 +15,7 @@ - + diff --git a/src/WinSW/WinSW.csproj b/src/WinSW/WinSW.csproj index 8606bc6..c30c0a0 100644 --- a/src/WinSW/WinSW.csproj +++ b/src/WinSW/WinSW.csproj @@ -2,7 +2,7 @@ Exe - net20;net40;net461;net5.0-windows + net20;net40;net461;net6.0-windows latest enable true @@ -16,16 +16,15 @@ Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors - + true - true - + 3.0.41 - + @@ -35,23 +34,15 @@ - - - - x64 - - - - x86 - + - + - + v2