Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edf51bc

Browse files
committed
Update build to use .NET SDK 8 and C# 12
1 parent 3cb1ad2 commit edf51bc

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

.github/workflows/.global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.100",
4+
"rollForward": "latestMinor"
5+
}
6+
}

.github/workflows/pull-request.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ jobs:
1919
- name: Add MSBuild to PATH
2020
uses: microsoft/setup-msbuild@v1
2121

22+
- name: Replace global.json
23+
run: cp .github/workflows/.global.json global.json
24+
shell: bash
25+
2226
- name: Install .NET SDK
2327
uses: actions/setup-dotnet@v3
2428
with:
2529
dotnet-version: |
2630
6.0.x
27-
7.0.x
31+
8.0.x
2832
2933
- name: Get .NET information
3034
run: dotnet --info

.github/workflows/push-main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ jobs:
2222
- name: Add MSBuild to PATH
2323
uses: microsoft/setup-msbuild@v1
2424

25+
- name: Replace global.json
26+
run: cp .github/workflows/.global.json global.json
27+
shell: bash
28+
2529
- name: Install .NET SDK
2630
uses: actions/setup-dotnet@v3
2731
with:
2832
dotnet-version: |
2933
6.0.x
30-
7.0.x
34+
8.0.x
3135
3236
- name: Get .NET information
3337
run: dotnet --info

Directory.build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
88
<DebugType>embedded</DebugType>
99
<EmbedUntrackedSources>true</EmbedUntrackedSources>
10-
<LangVersion>latest</LangVersion>
10+
<LangVersion>12.0</LangVersion>
1111
<MSBuildCopyContentTransitively>false</MSBuildCopyContentTransitively>
1212
<PackageIcon>logo-512-transparent.png</PackageIcon>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>

build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) {
2121
}
2222

2323
$version = [Version]$([regex]::matches((&dotnet --version), '^(\d+\.)?(\d+\.)?(\*|\d+)').value)
24-
if ($version.Major -lt 7) {
25-
throw ".NET SDK version ($version) is too low; please install version 7.0 or later"
24+
if ($version.Major -lt 8) {
25+
throw ".NET SDK version ($version) is too low; please install version 8.0 or later"
2626
}
2727

2828
if ($null -eq (Get-Command "msbuild.exe" -ErrorAction Ignore)) {

test/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<DebugSymbols>true</DebugSymbols>
66
<DebugType>portable</DebugType>
77
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
8-
<LangVersion>latest</LangVersion>
8+
<LangVersion>12.0</LangVersion>
99
<PackageId>$(MSBuildProjectName)</PackageId>
1010
<VersionPrefix>99.99.99-dev</VersionPrefix>
1111
<WarningsAsErrors>true</WarningsAsErrors>

tools/builder/build.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<LangVersion>10.0</LangVersion>
54
<NoWarn>$(NoWarn);CS8002</NoWarn>
65
<Nullable>enable</Nullable>
76
<OutputType>Exe</OutputType>
8-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
98
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
109
</PropertyGroup>
1110

0 commit comments

Comments
 (0)