Skip to content

Commit 9bf11f8

Browse files
Upgraded to .NET 8.
1 parent 11e455b commit 9bf11f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+577
-1273
lines changed

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- name: Setup .NET
1313
uses: actions/setup-dotnet@v1
1414
with:
15-
dotnet-version: 6.0.x
15+
dotnet-version: 8.0.x
1616
- name: Publish with dotnet
17-
run: dotnet publish --configuration Release --output build
17+
run: dotnet publish ./src --configuration Release --output build
1818
- name: Deploy to Github Pages
1919
uses: JamesIves/github-pages-deploy-action@releases/v3
2020
with:

BlazorPages.sln

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
[![](../../workflows/gh-pages/badge.svg)](../../actions)
44

55

6-
This project is an example of using GitHub Actions to automatically deploy a .NET 5 client-side
6+
This project is an example of using GitHub Actions to automatically deploy a .NET 8 client-side
77
Blazor app to Github Pages. For a live demo, check the following link:
88

99
https://blazorgithubpages.github.io
1010

11-
Microsoft Docs already contains a [general overview](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/blazor/client-side?view=aspnetcore-5.0#github-pages)
11+
Microsoft Docs already contains a [general overview](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-8.0#github-pages)
1212
of the steps needed for a successful deploy.
1313

1414

1515
This project differs from [the project from which it's forked](https://github.com/fernandreu/blazor-pages) in that:
16-
- It is .NET 5, not .NET Core 3.1
16+
- It is .NET 8, not .NET Core 3.1
1717
- Fewer steps from fork to running site (see below)
1818

1919
## How to deploy
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8+
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
13+
</ItemGroup>
14+
15+
</Project>

src/Client/Pages/Counter.razor renamed to src/BlazorPages.Client/Pages/Counter.razor

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
@page "/counter"
2+
@rendermode InteractiveAuto
3+
4+
<PageTitle>Counter</PageTitle>
25

36
<h1>Counter</h1>
47

5-
<p>Current count: @currentCount</p>
8+
<p role="status">Current count: @currentCount</p>
69

710
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
811

src/BlazorPages.Client/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
3+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
4+
5+
await builder.Build().RunAsync();

src/Client/_Imports.razor renamed to src/BlazorPages.Client/_Imports.razor

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
@using Microsoft.AspNetCore.Components.Forms
44
@using Microsoft.AspNetCore.Components.Routing
55
@using Microsoft.AspNetCore.Components.Web
6+
@using static Microsoft.AspNetCore.Components.Web.RenderMode
67
@using Microsoft.AspNetCore.Components.Web.Virtualization
7-
@using Microsoft.AspNetCore.Components.WebAssembly.Http
88
@using Microsoft.JSInterop
9-
@using Client
10-
@using Client.Shared
9+
@using BlazorPages.Client
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

src/BlazorPages.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34525.116
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorPages", "BlazorPages\BlazorPages.csproj", "{42DFC2EA-9780-40A1-A765-9EC343E3BA46}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorPages.Client", "BlazorPages.Client\BlazorPages.Client.csproj", "{5AA04AC3-9498-43B4-9AFF-71546CF27739}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{42DFC2EA-9780-40A1-A765-9EC343E3BA46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{42DFC2EA-9780-40A1-A765-9EC343E3BA46}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{42DFC2EA-9780-40A1-A765-9EC343E3BA46}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{42DFC2EA-9780-40A1-A765-9EC343E3BA46}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{5AA04AC3-9498-43B4-9AFF-71546CF27739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{5AA04AC3-9498-43B4-9AFF-71546CF27739}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{5AA04AC3-9498-43B4-9AFF-71546CF27739}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{5AA04AC3-9498-43B4-9AFF-71546CF27739}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {1EB7FBE4-8891-4047-8811-D3C3D8BAB998}
30+
EndGlobalSection
31+
EndGlobal

0 commit comments

Comments
 (0)