bump: 迁移到.net 8

This commit is contained in:
jackfiled 2023-11-19 12:55:02 +08:00
parent 0f8154e968
commit 8fa0f5bc0f
19 changed files with 44 additions and 53 deletions

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<base href="/"/>
<link href="css/site.css" rel="stylesheet"/>
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
<link href="Frontend.styles.css" rel="stylesheet">
<HeadOutlet @rendermode="@InteractiveServer" />
</head>
<body>
<Routes @rendermode="@InteractiveServer" />
<text>
An error has occurred. This application may not response until reloaded.
</text>
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
<script src="_content/BlazorMonaco/jsInterop.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
<script src="_framework/blazor.web.js"></script>
<script src="js/helper.js"></script>
</body>
</html>

View File

@ -30,4 +30,6 @@
</Content> </Content>
</Layout> </Layout>
</Layout> </Layout>
</div> </div>
<AntContainer/>

View File

@ -1,4 +1,4 @@
<Router AppAssembly="@typeof(App).Assembly"> <Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData"> <Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
<FocusOnNavigate RouteData="@routeData" Selector="h1"/> <FocusOnNavigate RouteData="@routeData" Selector="h1"/>
@ -9,6 +9,4 @@
<p role="alert">Sorry, there's nothing at this address.</p> <p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView> </LayoutView>
</NotFound> </NotFound>
</Router> </Router>
<AntContainer/>

View File

@ -2,10 +2,10 @@
@using System.Net.Http.Json @using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using AntDesign @using AntDesign
@using BlazorMonaco @using BlazorMonaco
@using BlazorMonaco.Editor @using BlazorMonaco.Editor
@using BlazorMonaco.Languages @using BlazorMonaco.Languages
@using Frontend @using Frontend.Components
@using Frontend.Shared

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>

View File

@ -1,37 +0,0 @@
@page "/"
@using Microsoft.AspNetCore.Components.Web
@namespace Frontend.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<base href="~/"/>
<link href="css/site.css" rel="stylesheet"/>
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
<link href="Frontend.styles.css" rel="stylesheet">
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered"/>
</head>
<body>
<component type="typeof(App)" render-mode="ServerPrerendered"/>
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
<script src="_content/BlazorMonaco/jsInterop.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
<script src="_framework/blazor.server.js"></script>
<script src="js/helper.js"></script>
</body>
</html>

View File

@ -1,11 +1,12 @@
using Blazored.LocalStorage; using Blazored.LocalStorage;
using Frontend.Components;
using Katheryne; using Katheryne;
using Frontend.Services; using Frontend.Services;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args); WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages(); builder.Services.AddRazorComponents()
builder.Services.AddServerSideBlazor(); .AddInteractiveServerComponents();
builder.Services.AddAntDesign(); builder.Services.AddAntDesign();
builder.Services.AddBlazoredLocalStorage(); builder.Services.AddBlazoredLocalStorage();
@ -16,7 +17,9 @@ WebApplication app = builder.Build();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.MapBlazorHub(); app.UseAntiforgery();
app.MapFallbackToPage("/_Host");
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
await app.RunAsync(); await app.RunAsync();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="YamlDotNet" Version="13.7.0" /> <PackageReference Include="YamlDotNet" Version="13.7.0" />
</ItemGroup> </ItemGroup>