Revert "Upgrade to .NET 6 (#806)" (#817)

This reverts commit 6db5fbc2c3.
This commit is contained in:
Next Turn
2021-04-09 14:03:24 +08:00
committed by GitHub
parent 3c5884e7b8
commit 885877c12b
6 changed files with 36 additions and 27 deletions

View File

@@ -122,9 +122,7 @@ namespace WinSW
/// </exception>
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!);

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -15,13 +15,13 @@
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Security.AccessControl" Version="5.0.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<Reference Include="System.ServiceProcess" />

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net471;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net471;net5.0-windows</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>
@@ -20,7 +20,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
<Reference Include="System.ServiceProcess" />
</ItemGroup>
@@ -39,11 +39,11 @@
<Target Name="Copy" BeforeTargets="AfterBuild">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net6.0-windows\WinSW.runtimeconfig*.json" />
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net5.0-windows\WinSW.runtimeconfig*.json" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net461\System.ValueTuple.dll" />
</ItemGroup>

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -16,11 +16,11 @@
<Copyright>Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows' AND '$(RuntimeIdentifier)' != ''">
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0-windows' AND '$(RuntimeIdentifier)' != ''">
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<PropertyGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<ILMergeVersion>3.0.41</ILMergeVersion>
</PropertyGroup>
@@ -28,7 +28,7 @@
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20303.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<PackageReference Include="ilmerge" Version="$(ILMergeVersion)" />
<Reference Include="System.ServiceProcess" />
</ItemGroup>
@@ -38,11 +38,18 @@
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
<ProjectReference Include="..\WinSW.Tasks\WinSW.Tasks.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net6.0-windows'">
<Target Name="PublishCoreZip" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net5.0-windows' and '$(IncludeNativeLibrariesForSelfExtract)' != 'true'">
<MakeDir Directories="$(ArtifactsPublishDir)" />
<ZipDirectory SourceDirectory="$(PublishDir)" DestinationFile="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).zip" Overwrite="true" />
</Target>
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net5.0-windows' and '$(IncludeNativeLibrariesForSelfExtract)' == 'true'">
<MakeDir Directories="$(ArtifactsPublishDir)" />
<Copy SourceFiles="$(PublishDir)$(TargetName).exe" DestinationFiles="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).exe" />
@@ -50,7 +57,7 @@
</Target>
<!-- Merge plugins and other DLLs into the executable -->
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net6.0-windows'">
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net5.0-windows'">
<PropertyGroup>
<InputAssemblies>"$(OutDir)$(TargetFileName)"</InputAssemblies>
@@ -78,7 +85,7 @@
</Target>
<UsingTask TaskName="WinSW.Tasks.Trim" AssemblyFile="$(ArtifactsBinDir)WinSW.Tasks\$(Configuration)\net461\WinSW.Tasks.dll" />
<Target Name="Trim" AfterTargets="Merge" Condition="'$(TargetFramework)' != 'net6.0-windows'">
<Target Name="Trim" AfterTargets="Merge" Condition="'$(TargetFramework)' != 'net5.0-windows'">
<Trim Path="$(ArtifactsPublishDir)WinSW-$(TargetFramework).exe" />
</Target>