Skip to content

Commit 5a830a0

Browse files
authored
chore: dotnet upgrade from 6.0 -> 8.0 (#32894)
### Issue #32804 Closes #32804 ### Reason for this change New projects in C# and F# are initialized using .NET6.0, which was designated EOL 12 NOV 2024. ### Description of changes Upgraded .NET from 6.0 (EOL) -> 8.0 (LTS) for new projects in C# and F#. ### Describe any new or updated permissions being added No permissions changes. ### Description of how you validated changes Changed unit tests to check for .NET8.0 instead of .NET6.0, and ran them successfully. <img width="768" alt="Screenshot 2025-01-13 at 12 53 25" src="https://github.com/user-attachments/assets/2992bd18-382a-43fc-826f-59c41214a8cb" /> ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ef135ef commit 5a830a0

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

packages/aws-cdk/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

packages/aws-cdk/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

packages/aws-cdk/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

packages/aws-cdk/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<!-- Roll forward to future major versions of the netcoreapp as needed -->
77
<RollForward>Major</RollForward>
88
</PropertyGroup>

packages/aws-cdk/test/init.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('constructs version', () => {
9797
const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/);
9898

9999
expect(csproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
100-
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
100+
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net8.0<\/TargetFramework>/));
101101
expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.csproj\"/));
102102
});
103103

@@ -119,7 +119,7 @@ describe('constructs version', () => {
119119
const sln = (await fs.readFile(slnFile, 'utf8')).split(/\r?\n/);
120120

121121
expect(fsproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
122-
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
122+
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net8.0<\/TargetFramework>/));
123123
expect(sln).toContainEqual(expect.stringMatching(/\"AwsCdkTest[a-zA-Z0-9]{6}\\AwsCdkTest[a-zA-Z0-9]{6}.fsproj\"/));
124124
});
125125

@@ -138,7 +138,7 @@ describe('constructs version', () => {
138138
const csproj = (await fs.readFile(csprojFile, 'utf8')).split(/\r?\n/);
139139

140140
expect(csproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
141-
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
141+
expect(csproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net8.0<\/TargetFramework>/));
142142
});
143143

144144
cliTestWithDirSpaces('fsharp app with spaces', async (workDir) => {
@@ -156,7 +156,7 @@ describe('constructs version', () => {
156156
const fsproj = (await fs.readFile(fsprojFile, 'utf8')).split(/\r?\n/);
157157

158158
expect(fsproj).toContainEqual(expect.stringMatching(/\<PackageReference Include="Constructs" Version="\[10\..*,11\..*\)"/));
159-
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net6.0<\/TargetFramework>/));
159+
expect(fsproj).toContainEqual(expect.stringMatching(/\<TargetFramework>net8.0<\/TargetFramework>/));
160160
});
161161

162162
cliTest('create a Python app project', async (workDir) => {

0 commit comments

Comments
 (0)