Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet 8 #14058

Merged
merged 31 commits into from
Oct 23, 2023
Merged

Dotnet 8 #14058

Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1978ea7
Testing dotnet 8 preview
jtkech Aug 1, 2023
06e8f31
Bad character
jtkech Aug 2, 2023
684bc01
wip
jtkech Aug 2, 2023
7e10c78
wip
jtkech Aug 2, 2023
6e404ec
Try Github action for dotnet 8 preview
jtkech Aug 2, 2023
b3acc43
Also build net8.0
jtkech Aug 2, 2023
b2b4d06
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Aug 2, 2023
1b2ec1e
Fix build
jtkech Aug 2, 2023
9d55d03
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Aug 4, 2023
f2f78ff
Update .vscode json files
jtkech Aug 4, 2023
aa9b23a
Update github actions
jtkech Aug 4, 2023
29ef720
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Aug 17, 2023
d21a42c
Use preview7
sebastienros Aug 17, 2023
a1900d0
Update preview.7
sebastienros Aug 17, 2023
2be899f
Isolate 'DefaultMeterFactory' singleton per tenant
jtkech Aug 18, 2023
65e89c5
Compiler directives
jtkech Aug 18, 2023
a996483
Revert "Compiler directives"
jtkech Aug 18, 2023
872d109
Revert "Isolate 'DefaultMeterFactory' singleton per tenant"
jtkech Aug 18, 2023
6943eb2
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Oct 7, 2023
5432455
Remove net6.0
jtkech Oct 7, 2023
216cde4
Update 8.0.0-rc.1 version
jtkech Oct 7, 2023
2e14168
Isolate metrics services
jtkech Oct 7, 2023
7ab313f
Compiler directives
jtkech Oct 7, 2023
ef6f5ca
Update sdk version
jtkech Oct 7, 2023
5189f8f
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Oct 19, 2023
0c77ef8
Revert a now useless change, update a comment
jtkech Oct 19, 2023
157dd69
Update to rc2
jtkech Oct 19, 2023
bb80a6a
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Oct 20, 2023
5f71a16
Re-add net6.0
jtkech Oct 20, 2023
2c0cfba
Merge remote-tracking branch 'origin/main' into jtkech/dotnet8
jtkech Oct 23, 2023
00dff46
Reuse FileProvider Dispose but with compiler directive
jtkech Oct 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/functional_all_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- uses: actions/setup-node@v3
with:
node-version: "15"
Expand All @@ -43,7 +43,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
# We need to install dotnet in the docker container.
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Functional Tests
run: |
cd test/OrchardCore.Tests.Functional
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac_unit_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- uses: actions/checkout@v3
- name: Build and test
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
5 changes: 4 additions & 1 deletion .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "15"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-rc.2.23502.2'
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 16368 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0
dotnet build -c Release -f net7.0
dotnet build -c Release -f net6.0
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:dev .
docker push orchardproject/orchardcore-cms-linux:dev
- name: Deploy preview docker image for windows
Expand All @@ -73,7 +73,7 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-windows:dev .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:dev
6 changes: 3 additions & 3 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER + 15471 ))" >> $GITHUB_ENV
- name: Build
run: |
dotnet build -c Release -f net8.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
dotnet build -c Release -f net7.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
dotnet build -c Release -f net6.0 -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: Unit Tests
run: |
dotnet test -c Release --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} .
docker push orchardproject/orchardcore-cms-linux:latest
docker push "orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }}"
Expand All @@ -85,7 +85,7 @@ jobs:
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item -Recurse -Confirm:$false
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false
$output = [System.IO.Path]::GetFullPath("./.build/release")
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net7.0
dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:${{ steps.get_version.outputs.VERSION }} .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows:latest
Expand Down
22 changes: 11 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console debug) - net7.0",
"name": ".NET Core Launch (console debug) - net8.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (debug) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -15,12 +15,12 @@
"stopAtEntry": false
},
{
"name": ".NET Core Launch (web debug) - net7.0",
"name": ".NET Core Launch (web debug) - net8.0",
"type": "coreclr",
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "dotnet build (debug) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (debug) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net8.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -33,11 +33,11 @@
}
},
{
"name": ".NET Core Launch (web release) - net7.0",
"name": ".NET Core Launch (web release) - net8.0",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "dotnet build (release) - net7.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net7.0/OrchardCore.Cms.Web.dll",
"preLaunchTask": "dotnet build (release) - net8.0",
"program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net8.0/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"env": {
Expand All @@ -50,10 +50,10 @@
}
},
{
"name": ".NET Core Launch (web debug) - dotnet watch - net7.0",
"name": ".NET Core Launch (web debug) - dotnet watch - net8.0",
"type": "dotnetwatchattach",
"request": "launch",
"task": "dotnet watch - net7.0",
"task": "dotnet watch - net8.0",
"program": "OrchardCore.Cms.Web.exe",
"args": {
"env": {
Expand Down
42 changes: 21 additions & 21 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"tasks": [
{
"label": "dotnet watch - net7.0",
"label": "dotnet watch - net8.0",
"type": "process",
"command": "dotnet",
"args": [
"watch",
"run",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"-f",
"net7.0"
"net8.0"
],
"options": {
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web"
Expand All @@ -48,7 +48,7 @@
"--project",
"${workspaceRoot}\\src\\OrchardCore.Cms.Web\\OrchardCore.Cms.Web.csproj",
"-f",
"net7.0"
"net8.0"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
]
},
{
"label": "dotnet build (debug) - net7.0",
"label": "dotnet build (debug) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -98,12 +98,12 @@
"-c",
"Debug",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet build (release) - net7.0",
"label": "dotnet build (release) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -112,12 +112,12 @@
"-c",
"Release",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (debug) - net7.0",
"label": "dotnet rebuild (debug) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -127,12 +127,12 @@
"-c",
"Debug",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet rebuild (release) - net7.0",
"label": "dotnet rebuild (release) - net8.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -142,7 +142,7 @@
"-c",
"Release",
"-f",
"net7.0"
"net8.0"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -163,7 +163,7 @@
]
},
{
"label": "dotnet publish (self-contained) - release - net7.0",
"label": "dotnet publish (self-contained) - release - net8.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -177,7 +177,7 @@
"win-x64",
"--self-contained",
"--framework",
"net7.0",
"net8.0",
"--output",
".\\.build\\release"
]
Expand All @@ -191,14 +191,14 @@
"linux-x64",
"--self-contained",
"--framework",
"net7.0",
"net8.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet publish (framework dependent) - release - net7.0",
"label": "dotnet publish (framework dependent) - release - net8.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand All @@ -213,7 +213,7 @@
"--self-contained",
"false",
"--framework",
"net7.0",
"net8.0",
"--output",
".\\.build\\release"
]
Expand All @@ -228,24 +228,24 @@
"--self-contained",
"false",
"--framework",
"net7.0",
"net8.0",
"--output",
"./.build/release"
],
"problemMatcher": "$msCompile"
},
{
"label": "tasks: dotnet publish release (self-contained) - net7.0",
"label": "tasks: dotnet publish release (self-contained) - net8.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (self-contained) - net7.0"
"dotnet publish (self-contained) - net8.0"
]
},
{
"label": "tasks: dotnet publish release (framework dependent) - net7.0",
"label": "tasks: dotnet publish release (framework dependent) - net8.0",
"dependsOn": [
"cleanup publish folder",
"dotnet publish (framework dependent) - net7.0"
"dotnet publish (framework dependent) - net8.0"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions src/OrchardCore.Build/Dependencies.AspNetCore.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<!-- TFM used when coding in Visual Studio and when creating templates -->
<!-- All 'template.json' should provide a 'choice' for the default TFM -->
<DefaultTargetFramework>net7.0</DefaultTargetFramework>
<DefaultTargetFramework>net8.0</DefaultTargetFramework>

<!-- TFMs used to build the abstractions and modules, by convention the default TFM is at the first position -->
<!-- In a cross-targeting build, some assets are only copied on the first TFM, by convention the default TFM -->
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net7.0;net6.0</CommonTargetFrameworks>
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net8.0;net7.0</CommonTargetFrameworks>
</PropertyGroup>

<!-- Detect if the solution is opened in VS to limit the TFMs that are analyzed by Roslyn for performance reasons -->
Expand All @@ -20,13 +20,13 @@
<!-- These versions are used for the NuGet packages that are dependent on the current TFM -->
<!-- Versions are preset for the default TFM (there may be no TFM in an evaluation phase) -->
<PropertyGroup>
<AspNetCorePackagesVersion>7.0.12</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>7.0.12</MicrosoftExtensionsPackagesVersion>
<AspNetCorePackagesVersion>8.0.0-rc.2.23480.2</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>8.0.0-rc.2.23480.2</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework) == 'net6.0'">
<AspNetCorePackagesVersion>6.0.23</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>6.0.23</MicrosoftExtensionsPackagesVersion>
<PropertyGroup Condition="$(TargetFramework) == 'net7.0'">
<AspNetCorePackagesVersion>7.0.12</AspNetCorePackagesVersion>
<MicrosoftExtensionsPackagesVersion>7.0.12</MicrosoftExtensionsPackagesVersion>
</PropertyGroup>

<!-- 'Microsoft.AspNetCore' packages that are not included in the ASP.NET Core shared framework -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ namespace OrchardCore.GitHub.Configuration
{
public class GitHubHandler : OAuthHandler<GitHubOptions>
{

#if !NET8_0_OR_GREATER
public GitHubHandler(IOptionsMonitor<GitHubOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)
: base(options, logger, encoder, clock)
{ }
#else
public GitHubHandler(IOptionsMonitor<GitHubOptions> options, ILoggerFactory logger, UrlEncoder encoder)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this also works for NET7.0 then we should use this in all cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn’t work on net7.0

: base(options, logger, encoder)
{ }
#endif

protected override async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
{
Expand Down
Loading
Loading