Skip to content

Commit ff1ae46

Browse files
authored
Drop support for .NET 6 (#308)
1 parent bf5f6a4 commit ff1ae46

File tree

9 files changed

+18
-32
lines changed

9 files changed

+18
-32
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ env:
1616
BuildConfiguration: 'Debug'
1717
BuildPlatform: 'Any CPU'
1818
ContinuousIntegrationBuild: 'true'
19-
DotNet6Version: '6.x'
2019
DotNet8Version: '8.x'
2120
DotNet9Version: '9.x'
2221

@@ -43,11 +42,10 @@ jobs:
4342
with:
4443
fetch-depth: 0
4544

46-
- name: Install .NET ${{ env.DotNet6Version }} and .NET ${{ env.DotNet8Version }}
45+
- name: Install .NET ${{ env.DotNet8Version }}
4746
uses: actions/setup-dotnet@v4
4847
with:
4948
dotnet-version: |
50-
${{ env.DotNet6Version }}
5149
${{ env.DotNet8Version }}
5250
5351
- name: Install .NET ${{ env.DotNet9Version }}
@@ -63,10 +61,6 @@ jobs:
6361
if: ${{ matrix.name == 'Windows' }}
6462
run: dotnet test --no-restore --no-build --framework net472 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net472.binlog"
6563

66-
- name: Run Unit Tests (.NET 6)
67-
if: ${{ matrix.name != 'MacOS' }}
68-
run: dotnet test --no-restore --no-build --framework net6.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net6.0.binlog"
69-
7064
- name: Run Unit Tests (.NET 8)
7165
run: dotnet test --no-restore --no-build --framework net8.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net8.0.binlog"
7266

.github/workflows/Official.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ env:
1515
BuildPlatform: 'Any CPU'
1616
ContinuousIntegrationBuild: 'true'
1717
OfficialBuild: 'true'
18-
DotNet6Version: '6.x'
1918
DotNet8Version: '8.x'
2019

2120
jobs:
@@ -29,11 +28,10 @@ jobs:
2928
with:
3029
fetch-depth: 0
3130

32-
- name: Install .NET ${{ env.DotNet6Version }} and .NET ${{ env.DotNet8Version }}
31+
- name: Install .NET ${{ env.DotNet8Version }}
3332
uses: actions/setup-dotnet@v4
3433
with:
3534
dotnet-version: |
36-
${{ env.DotNet6Version }}
3735
${{ env.DotNet8Version }}
3836
3937
- name: Install .NET ${{ env.DotNet9Version }}

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/BuildTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,11 @@ public void CanBuildLotsOfProjects()
144144
{
145145
projects.Add(
146146
ProjectCreator.Create(GetTempProjectPath())
147+
.UsingTaskRoslynCodeTaskFactory(
148+
taskName: "Sleep",
149+
sourceCode: "System.Threading.Thread.Sleep(2000);")
147150
.Target("Build")
148-
.Task(
149-
"Exec",
150-
parameters: new Dictionary<string, string?>
151-
{
152-
["Command"] = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "ping 127.0.0.1 -n 2 >NUL" : "sleep 2",
153-
})
151+
.Task("Sleep")
154152
.Save());
155153
}
156154

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/Microsoft.Build.Utilities.ProjectCreation.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net6.0;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
</PropertyGroup>
66
<Import Project="..\Microsoft.Build.Utilities.ProjectCreation\build\MSBuild.ProjectCreation.props" Condition="'$(TargetFramework)' == 'net472'" />

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/SdkCsprojTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace Microsoft.Build.Utilities.ProjectCreation.UnitTests
99
{
1010
public class SdkCsprojTests : TestBase
1111
{
12-
#if !NET6_0
1312
[Fact]
1413
public void CanBuild()
1514
{
@@ -21,7 +20,6 @@ public void CanBuild()
2120

2221
result.ShouldBeTrue(buildOutput.GetConsoleLog());
2322
}
24-
#endif
2523

2624
[Fact]
2725
public void CustomSdk()

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/TestBase.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ protected TestBase()
1818
public string DotNetSdkVersion
1919
{
2020
get =>
21-
#if NET6_0
22-
"6.0.100";
23-
#elif NET8_0 || NETFRAMEWORK
21+
#if NET8_0 || NETFRAMEWORK
2422
"8.0.100";
2523
#elif NET9_0 || NETFRAMEWORK
2624
"9.0.0";
@@ -32,9 +30,7 @@ public string DotNetSdkVersion
3230
public string TargetFramework
3331
{
3432
get =>
35-
#if NET6_0
36-
"net6.0";
37-
#elif NET8_0
33+
#if NET8_0
3834
"net8.0";
3935
#elif NET9_0
4036
"net9.0";

src/Microsoft.Build.Utilities.ProjectCreation/MSBuildAssemblyResolver.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.IO;
88
using System.Linq;
99
using System.Reflection;
10-
#if NET6_0_OR_GREATER
10+
#if NET8_0_OR_GREATER
1111
using System.Runtime.Loader;
1212
#endif
1313

@@ -28,10 +28,11 @@ public static partial class MSBuildAssemblyResolver
2828
Environment.SetEnvironmentVariable("MSBuildExtensionsPath", DotNetSdksPath);
2929
Environment.SetEnvironmentVariable("MSBuildSDKsPath", string.IsNullOrWhiteSpace(DotNetSdksPath) ? null : Path.Combine(DotNetSdksPath, "Sdks"));
3030

31-
#if NET6_0_OR_GREATER
32-
AssemblyLoadContext.Default.Resolving += AssemblyResolve;
33-
#else
31+
#if NETFRAMEWORK
3432
AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve;
33+
34+
#else
35+
AssemblyLoadContext.Default.Resolving += AssemblyResolve;
3536
#endif
3637

3738
return new object();
@@ -78,7 +79,7 @@ public static partial class MSBuildAssemblyResolver
7879
}
7980

8081
AssemblyName candidateAssemblyName = AssemblyName.GetAssemblyName(candidateAssemblyFile.FullName);
81-
#if !NET7_0_OR_GREATER
82+
#if NETFRAMEWORK
8283
if (requestedAssemblyName.ProcessorArchitecture != System.Reflection.ProcessorArchitecture.None && requestedAssemblyName.ProcessorArchitecture != candidateAssemblyName.ProcessorArchitecture)
8384
{
8485
// The requested assembly has a processor architecture and the candidate assembly has a different value

src/Microsoft.Build.Utilities.ProjectCreation/Microsoft.Build.Utilities.ProjectCreation.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net6.0;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<ArtifactsPath>..\..\artifacts\$(MSBuildProjectName)</ArtifactsPath>
@@ -31,6 +31,7 @@
3131
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" Condition="'$(OfficialBuild)' != 'true'" />
3232
<PackageReference Include="Microsoft.IO.Redist" Condition="'$(TargetFramework)' == 'net472'" />
3333
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Runtime" PrivateAssets="All" />
34+
<PackageReference Include="System.CodeDom" VersionOverride="9.0.0-rc.2.24473.5" Condition="'$(TargetFramework)' == 'net9.0'" />
3435
<PackageReference Include="System.IO.Compression" Condition="'$(TargetFramework)' == 'net472'" />
3536
<PackageReference Include="System.Text.Json" />
3637
<PackageReference Include="System.ValueTuple" VersionOverride="4.5.0" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Compile" />

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "13.0",
2+
"version": "14.0",
33
"assemblyVersion": "1.0",
44
"buildNumberOffset": -2,
55
"nugetPackageVersion": {

0 commit comments

Comments
 (0)