Skip to content

Commit 9ac0b3e

Browse files
authored
Update to .NET 10, add DocFX workaround (#420)
* Add temporary workaround until docfx version is available that is compatible with .NET 10 * Install missing .NET versions * Update website to .NET 10 Repro for NavigationException: Open site, paste /docs/v3/obsolete into browser, click Get Started > Documentation
1 parent d1e3af1 commit 9ac0b3e

7 files changed

Lines changed: 26 additions & 31 deletions

File tree

.config/dotnet-tools.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/build-and-stage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ env:
1818
AZURE_WEBAPP_PACKAGE_PATH: '.'
1919
DOTNET_CLI_TELEMETRY_OPTOUT: 1
2020
DOTNET_NOLOGO: true
21-
DOTNET_VERSION: '8.0.x'
2221
DOCFX_SOURCE_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
2322

2423
jobs:
@@ -31,7 +30,10 @@ jobs:
3130
- name: Setup .NET
3231
uses: actions/setup-dotnet@v4
3332
with:
34-
dotnet-version: ${{ env.DOTNET_VERSION }}
33+
dotnet-version: |
34+
8.0.*
35+
9.0.*
36+
10.0.*
3537
3638
- name: Generate API Browser docs
3739
shell: pwsh

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,6 @@ src/Steeltoe.io/wwwroot/*xrefmap.yml
417417

418418
# Overrides
419419
!docs/articles/releases
420+
421+
# Temporary workaround until a proper DocFX build supporting .NET 10 is available.
422+
docfx-net10-binaries/

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,3 @@ The site should now be running at <https://localhost:8080>.
4242
> [!NOTE]
4343
> If this is your first time running the site and you skip steps 1 and 2, none of the static content will be processed.
4444
> You will encounter `InvalidFileLink` warnings from files at the path `docs/api` and 404 errors when browsing the site.
45-
46-
### NavigationException while debugging
47-
48-
This site uses `NavigationManager` to redirect to static content in several places.
49-
When running the app locally, you will experience a `NavigationException` every time you are redirected.
50-
If you've already run the docfx steps, let the debugger continue, and you should be redirected to the static content as expected.
51-
52-
While annoying, this behavior is according to Blazor's design, and handling the exception would break the redirect.
53-
[Learn more about plans to address `NavigationException` in .NET 10](https://github.com/dotnet/aspnetcore/issues/59451).

build/build-metadata.ps1

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,26 @@ param (
66

77
set-StrictMode -Version Latest
88
$ErrorActionPreference = 'Stop'
9+
910
Write-Host "Starting value of DOCFX_SOURCE_BRANCH_NAME: '$env:DOCFX_SOURCE_BRANCH_NAME'"
1011
$OriginalSourceBranchName = $env:DOCFX_SOURCE_BRANCH_NAME
1112

12-
# Restore docfx tool
13-
dotnet tool restore
14-
1513
# Get the script's directory
1614
$baseDir = Split-Path -Parent $MyInvocation.MyCommand.Path
1715
Push-Location $baseDir
1816

17+
function EnsureDocfxBinaries() {
18+
# Temporary workaround until a proper DocFX build supporting .NET 10 is available.
19+
$zipFile = [IO.Path]::Combine($env:TEMP, 'docfx-net10-binaries.zip')
20+
21+
if (!(Test-Path -Path 'docfx-net10-binaries')) {
22+
Invoke-WebRequest -Uri 'https://ent.box.com/shared/static/7uekfex8ugc1kijt60lwx6q4n1r3d1m6.zip' -Method 'GET' -OutFile $zipFile
23+
Expand-Archive $zipFile -Force
24+
}
25+
}
26+
27+
EnsureDocfxBinaries
28+
1929
# Repository information
2030
$gitSourcesUrl = 'https://github.com/SteeltoeOSS/Steeltoe'
2131

@@ -55,8 +65,8 @@ function Clone-Source-Build-Metadata
5565

5666
Write-Output "Setting DOCFX_SOURCE_BRANCH_NAME to '$branch'"
5767
$env:DOCFX_SOURCE_BRANCH_NAME = $branch
58-
Write-Output "Running command: dotnet docfx metadata $apiFile"
59-
dotnet docfx metadata $apiFile
68+
Write-Output "Running command: dotnet exec docfx-net10-binaries/docfx.dll metadata $apiFile"
69+
dotnet exec docfx-net10-binaries/docfx.dll metadata $apiFile
6070
}
6171

6272
$buildAll = $false;
@@ -90,7 +100,7 @@ if ($SteeltoeVersion -eq 'source')
90100
Write-Output "Setting DOCFX_SOURCE_BRANCH_NAME back to '$OriginalSourceBranchName'"
91101
$env:DOCFX_SOURCE_BRANCH_NAME = $OriginalSourceBranchName
92102

93-
$buildArgs = @('docfx', 'build', (Join-Path '..' 'docs' 'docfx-all.json'))
103+
$buildArgs = @('exec', 'docfx-net10-binaries/docfx.dll', 'build', (Join-Path '..' 'docs' 'docfx-all.json'))
94104
if ($buildAll -eq $true) {
95105
$buildArgs += '--warningsAsErrors'
96106
$buildArgs += 'true'

src/Steeltoe.io/Properties/launchSettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
23
"profiles": {
34
"localhost": {
45
"commandName": "Project",

src/Steeltoe.io/Steeltoe.io.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
5+
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
56
</PropertyGroup>
67
</Project>

0 commit comments

Comments
 (0)