Skip to content

Commit 33dd3c8

Browse files
kblokclaude
andauthored
Migrate from .NET 8 to .NET 10 (#3129)
* Migrate from .NET 8 to .NET 10 .NET 10 is now the current LTS release. This updates all project files, CI workflows, and related settings to target .NET 10. - Update TargetFramework(s) from net8.0 to net10.0 across all projects - Update LangVersion from 12 to 14 (C# 14 ships with .NET 10) - Update AnalysisLevel from 8.0-Recommended to 10.0-Recommended - Update Microsoft.Extensions.Logging from 8.0.0 to 10.0.0 - Update all GitHub Actions workflows to use .NET SDK 10.0.x - Fix PushNugetPackageToIntNugetOrg workflow (was still on 7.0.x) - Remove Microsoft.CSharp and System.Net.Http packages from tests (now included in .NET 10, NU1510 errors) - Suppress ASPDEPR004/ASPDEPR008 in TestServer for deprecated IWebHost/WebHostBuilder APIs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update WebDriverBiDi-Relaxed to 0.0.42 for .NET 10 compatibility v0.0.42 fixes a System.Text.Json source generator error where [JsonInclude] on protected properties in RemoteReference is rejected by .NET 10 (properties changed to protected internal). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix hardcoded net8.0 path in FixturesTests The subprocess working directory path was hardcoded to net8.0 instead of net10.0, causing ShouldDumpBrowserProcessStderr to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Suppress AOT/trim analysis errors in demo project .NET 10 promotes AOT and trim analysis warnings to errors by default during PublishAot. PuppeteerSharp is not fully AOT/trim-compatible, so suppress these in the demo project. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 08f650d commit 33dd3c8

21 files changed

Lines changed: 42 additions & 41 deletions

File tree

.github/workflows/PushNugetPackageToIntNugetOrg.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55

66
env:
7-
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
7+
DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
88

99
jobs:
1010
PushToIntNugetOrg:
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET
1515
uses: actions/setup-dotnet@v3
1616
with:
17-
dotnet-version: 7.0.x
17+
dotnet-version: 10.0.x
1818
- name: Install dependencies
1919
run: |
2020
dotnet restore lib/PuppeteerSharp.sln

.github/workflows/PushNugetPackageToNugetOrg.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- v*
88

99
env:
10-
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
10+
DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
1111

1212
jobs:
1313
PushToNugetOrg:
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v3
1919
with:
20-
dotnet-version: 8.0.x
20+
dotnet-version: 10.0.x
2121
- name: Install dependencies
2222
run: |
2323
dotnet restore lib/PuppeteerSharp.sln

.github/workflows/demo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [windows-2022, macos-latest]
2222
browser: [chrome, firefox]
2323
env:
24-
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
24+
DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
2525

2626
steps:
2727
- uses: actions/checkout@v2
@@ -38,12 +38,12 @@ jobs:
3838
- name: Run on .NET
3939
working-directory: ./demos/PuppeteerSharpPdfDemo
4040
run: |
41-
dotnet run --project PuppeteerSharpPdfDemo-Local.csproj auto-exit ${{ matrix.browser }} -f net8.0
41+
dotnet run --project PuppeteerSharpPdfDemo-Local.csproj auto-exit ${{ matrix.browser }} -f net10.0
4242
- name: Run with AOT
4343
if: matrix.os == 'windows-2022'
4444
working-directory: ./demos/PuppeteerSharpPdfDemo
4545
run: |
46-
dotnet publish PuppeteerSharpPdfDemo-Local.csproj -r win-x64 -o build -f net8.0
46+
dotnet publish PuppeteerSharpPdfDemo-Local.csproj -r win-x64 -o build -f net10.0
4747
build/PuppeteerSharpPdfDemo-Local.exe auto-exit ${{ matrix.browser }}
4848
- name: Run on .NET Framework
4949
if: matrix.os == 'windows-2022'

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- '**.runsettings'
1717

1818
env:
19-
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
19+
DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
2020

2121
jobs:
2222
build:

.github/workflows/on-push-do-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Setup .NET
1010
uses: actions/setup-dotnet@v3
1111
with:
12-
dotnet-version: 8.0.x
12+
dotnet-version: 10.0.x
1313
- name: Run MarkdownSnippets
1414
run: |
1515
dotnet tool install --global MarkdownSnippets.Tool

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Publish docs
1818
runs-on: windows-latest
1919
env:
20-
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
20+
DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
2121

2222
steps:
2323
- uses: actions/checkout@v4

demos/PuppeteerSharpPdfDemo/PuppeteerSharpPdfDemo-Local.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFrameworks>net8.0;net481</TargetFrameworks>
5-
<LangVersion>12</LangVersion>
4+
<TargetFrameworks>net10.0;net481</TargetFrameworks>
5+
<LangVersion>14</LangVersion>
66
</PropertyGroup>
7-
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
7+
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
88
<PublishAot>true</PublishAot>
9+
<!-- PuppeteerSharp is not fully AOT/trim-compatible yet; suppress analysis errors -->
10+
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
11+
<NoWarn>$(NoWarn);IL3000;IL3050;IL3053</NoWarn>
912
</PropertyGroup>
1013
<ItemGroup>
1114
<ProjectReference Include="..\..\lib\PuppeteerSharp\PuppeteerSharp.csproj" />

demos/PuppeteerSharpPdfDemo/PuppeteerSharpPdfDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<LangVersion>default</LangVersion>
77
</PropertyGroup>
88
<ItemGroup>

lib/PuppeteerSharp.DevicesFetcher/PuppeteerSharp.DevicesFetcher.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
6-
<LangVersion>12</LangVersion>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<LangVersion>14</LangVersion>
77
</PropertyGroup>
88
<ItemGroup>
99
<ProjectReference Include="..\PuppeteerSharp\PuppeteerSharp.csproj" />

lib/PuppeteerSharp.Nunit/PuppeteerSharp.Nunit.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>12</LangVersion>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<LangVersion>14</LangVersion>
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="NUnit" Version="4.1.0" />

0 commit comments

Comments
 (0)