Skip to content

Commit 846e1a0

Browse files
authored
Merge pull request #268 from telerik/update-sample-apps-net8
Update sample and hybrid apps dotnet version
2 parents 2b5f555 + 36f15ac commit 846e1a0

24 files changed

+100
-92
lines changed

common/hybrid-blazor-apps/BlazorMauiApp/BlazorMauiApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0-maccatalyst;net7.0-ios;net7.0-android</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0-maccatalyst;net8.0-ios;net8.0-android</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>

common/hybrid-blazor-apps/BlazorWinFormsApp/BlazorWinFormsApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0-windows</TargetFramework>
4+
<TargetFramework>net8.0-windows</TargetFramework>
55
<OutputType>WinExe</OutputType>
66
<UseWindowsForms>true</UseWindowsForms>
77
<IsShippingPackage>false</IsShippingPackage>
88
</PropertyGroup>
99

1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="7.0.49" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="8.0.0-rc.2.9373" />
1313

1414
<!--if you want to try the trial version-->
1515
<!--<PackageReference Include="Telerik.UI.for.Blazor.Trial" Version="3,3.0" />-->

common/hybrid-blazor-apps/BlazorWpfApp/BlazorWpfApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0-windows</TargetFramework>
4+
<TargetFramework>net8.0-windows</TargetFramework>
55
<OutputType>WinExe</OutputType>
66
<UseWPF>true</UseWPF>
77
<IsShippingPackage>false</IsShippingPackage>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="7.0.49" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="8.0.0-rc.2.9373" />
1212

1313
<!--if you want to try the trial version-->
1414
<!--<PackageReference Include="Telerik.UI.for.Blazor.Trial" Version="3.3.0" />-->

common/hybrid-blazor-apps/WebviewAppShared/WebviewAppShared.csproj

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

33
<PropertyGroup>
44
<!--<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>-->
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<!--<ItemGroup>
99
<Reference Include="Microsoft.AspNetCore.Components.Web" />
1010
</ItemGroup>-->
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-rc.2.23480.2" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

sample-applications/blazing-coffee/BlazingCoffee/Client/BlazingCoffee.Client.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<!-- PWA -->
66
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
77
<!-- /PWA -->
@@ -20,9 +20,9 @@
2020

2121
<ItemGroup>
2222
<PackageReference Include="Blazored.LocalStorage" Version="4.1.5" />
23-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
24-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
25-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.2.23479.6" />
24+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.2.23479.6" PrivateAssets="all" />
25+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0-rc.2.23479.6" />
2626
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0" />
2727
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
2828
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />

sample-applications/blazing-coffee/BlazingCoffee/Client/wwwroot/index.html renamed to sample-applications/blazing-coffee/BlazingCoffee/Client/Host.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33

44
<head>
@@ -24,6 +24,7 @@
2424
<link href="manifest.json" rel="manifest" />
2525
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
2626
<!-- /PWA -->
27+
<HeadOutlet @rendermode="@RenderMode.InteractiveWebAssembly" />
2728
</head>
2829

2930
<body>
@@ -42,7 +43,7 @@
4243
</app>
4344

4445
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
45-
<script src="_framework/blazor.webassembly.js"></script>
46+
<script src="_framework/blazor.web.js"></script>
4647
<script src="js/themeChooser.js"></script>
4748
<script>
4849
window.themeChooser.init();

sample-applications/blazing-coffee/BlazingCoffee/Server/BlazingCoffee.Server.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<UserSecretsId>BlazingCoffee.Server-EE526336-C312-404E-8393-993CE0300831</UserSecretsId>
66
</PropertyGroup>
77

@@ -27,7 +27,7 @@
2727

2828
<ItemGroup>
2929
<PackageReference Include="CsvHelper" Version="16.0.0" />
30-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
30+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0-rc.2.23479.6" />
3131
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
3232
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
3333
<PrivateAssets>all</PrivateAssets>

sample-applications/blazing-coffee/BlazingCoffee/Server/Startup.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public void ConfigureServices(IServiceCollection services)
2626
{
2727
services.AddControllersWithViews();
2828
services.AddRazorPages();
29+
services.AddRazorComponents().AddInteractiveWebAssemblyComponents();
2930

3031
// Register Database for Store
3132
services.AddDbContext<CoffeeContext>(options => options.UseSqlite("Data Source=Coffee.db"));
@@ -55,11 +56,13 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5556

5657
app.UseRouting();
5758

59+
app.UseAntiforgery();
60+
5861
app.UseEndpoints(endpoints =>
5962
{
6063
endpoints.MapRazorPages();
6164
endpoints.MapControllers();
62-
endpoints.MapFallbackToFile("index.html");
65+
endpoints.MapRazorComponents<Client.Host>().AddInteractiveWebAssemblyRenderMode();
6366
});
6467
}
6568
}

sample-applications/blazing-coffee/BlazingCoffee/Shared/BlazingCoffee.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "7.0.0",
3+
"version": "8.0.0-rc.2.23479.6",
44
"rollForward": "latestFeature"
55
}
66
}

sample-applications/blazing-coffee/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The current demo app includes examples of the following features in the Blazor W
7777

7878
## Requirements
7979

80-
- [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
80+
- [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
8181
- [Telerik UI for Blazor](https://www.telerik.com/blazor-ui) (Trial or Commercial)
8282
- [npm](https://www.npmjs.com/) (node package manager, for sass themes)
8383

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
1-
<Router AppAssembly="typeof(Program).Assembly">
2-
<Found Context="routeData">
3-
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
4-
</Found>
5-
<NotFound>
6-
<h1>Page not found</h1>
7-
<p>Sorry, but there's nothing here!</p>
8-
</NotFound>
9-
</Router>
1+
@using Microsoft.Extensions.Hosting
2+
@inject IHostEnvironment Env
3+
4+
<!DOCTYPE html>
5+
<html lang="en">
6+
<head>
7+
<meta charset="utf-8" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
9+
<title>Telerik UI for Blazor Dashboard Sample App</title>
10+
<base href="/blazor-dashboard-app/" />
11+
<link href="favicon.ico" rel="icon" type="image/x-icon" />
12+
<link id="theme" href="https://blazor.cdn.telerik.com/blazor/4.6.0/kendo-theme-bootstrap/all.css" rel="stylesheet" />
13+
<link href="css/styles.css" rel="stylesheet" />
14+
<!-- Trial script file -->
15+
<!-- If you are using a commercial license, replace the telerik-blazor.js script tag with the one commented below. -->
16+
17+
<script src="_content/Telerik.UI.for.Blazor.Trial/js/telerik-blazor.js" defer></script>
18+
19+
<!-- /Trial script file -->
20+
<!-- Commercial script file -->
21+
<!--<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>-->
22+
<!-- /Commercial script file -->
23+
24+
<HeadOutlet @rendermode="@RenderMode.InteractiveServer" />
25+
</head>
26+
<body>
27+
<app id="app" class="app container-fluid"><Routes @rendermode="@RenderMode.InteractiveServer" /></app>
28+
29+
<div id="blazor-error-ui" class="alert alert-warning">
30+
@if (Env.IsDevelopment())
31+
{
32+
<text>An unhandled exception has occurred. See browser dev tools for details.</text>
33+
}
34+
else
35+
{
36+
<text>An error has occurred. This application may no longer respond until reloaded.</text>
37+
}
38+
<div class="pt-3">
39+
<a href class="reload k-button">Reload</a>
40+
</div>
41+
</div>
42+
43+
<script src="_framework/blazor.web.js"></script>
44+
</body>
45+
</html>

sample-applications/blazor-dashboard/BlazorDashboard/BlazorDashboard.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
5-
<LangVersion>9</LangVersion>
4+
<TargetFramework>net8.0</TargetFramework>
65
</PropertyGroup>
76

87
<ItemGroup>

sample-applications/blazor-dashboard/BlazorDashboard/Pages/_Host.cshtml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Router AppAssembly="typeof(Program).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<h1>Page not found</h1>
7+
<p>Sorry, but there's nothing here!</p>
8+
</NotFound>
9+
</Router>

sample-applications/blazor-dashboard/BlazorDashboard/Startup.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Startup(IConfiguration configuration)
2626
public void ConfigureServices(IServiceCollection services)
2727
{
2828
services.AddRazorPages();
29-
services.AddServerSideBlazor();
29+
services.AddRazorComponents().AddInteractiveServerComponents();
3030
services.AddSingleton<IssuesGenerator>();
3131
services.AddTelerikBlazor();
3232
}
@@ -52,10 +52,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5252

5353
app.UseRouting();
5454

55+
app.UseAntiforgery();
56+
5557
app.UseEndpoints(endpoints =>
5658
{
57-
endpoints.MapBlazorHub();
58-
endpoints.MapFallbackToPage("/_Host");
59+
endpoints.MapRazorComponents<App>().AddInteractiveServerRenderMode();
5960
});
6061
}
6162
}

sample-applications/blazor-dashboard/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This sample application showcases how easy it is to plug the Telerik Blazor comp
1313
To run this app locally, you need:
1414

1515
* to be able to run the latest Telerik UI for Blazor version (more details [here](https://docs.telerik.com/blazor-ui/getting-started/what-you-need))
16-
* .NET 7 installed - you can download it from [here](https://dotnet.microsoft.com/download)
16+
* .NET 8 installed - you can download it from [here](https://dotnet.microsoft.com/download)
1717

1818
If you don't have a commercial license for UI for Blazor, [start a trial](https://www.telerik.com/download-trial-file/v2-b/ui-for-blazor) and replace the package reference with `Telerik.UI.for.Blazor.Trial`.
1919

sample-applications/blazor-stocks/Client/BlazorFinancePortfolio.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
66
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.2.23479.6" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-rc.2.23479.6" PrivateAssets="all" />
1212
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
1313
<PackageReference Include="Telerik.UI.for.Blazor.Trial" Version="4.6.0" />
1414
<PackageReference Include="BlazorPro.BlazorSize" Version="3.1.0" />

sample-applications/blazor-stocks/Client/wwwroot/index.html renamed to sample-applications/blazor-stocks/Client/Host.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33

44
<head>
@@ -15,6 +15,7 @@
1515
<link rel="apple-touch-icon" sizes="512x512" href="default-icon-512x512.png" />
1616

1717
<link href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap" rel="stylesheet">
18+
<HeadOutlet @rendermode="@RenderMode.InteractiveWebAssembly" />
1819
</head>
1920

2021
<body>
@@ -36,7 +37,7 @@ <h2>Telerik Blazor Stocks Portfolio</h2>
3637
<a href class="reload btn-warning p-2"><span class="k-icon k-i-reload"></span> Reload</a>
3738
</div>
3839
</div>
39-
<script src="_framework/blazor.webassembly.js"></script>
40+
<script src="_framework/blazor.web.js"></script>
4041
<script src="_content/BlazorPro.BlazorSize/blazorSize.min.js"></script>
4142
<script>navigator.serviceWorker.register('service-worker.js');</script>
4243
<script src="custom-install-prompt.js"></script>

sample-applications/blazor-stocks/Server/BlazorFinancePortfolio.Server.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<DisableImplicitComponentsAnalyzers>true</DisableImplicitComponentsAnalyzers>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
9+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0-rc.2.23479.6" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)