Hi, @ram dem ,
Blazor template have been renamed. You can read more about that change in the 'Blazor templates renamed and simplified' section in the Preview 8 Release Blog Post.
Try to update Blazor templates and create Blazor Server App or Blazor WebAssembly App.
- Install latest Templates
dotnet new --install Microsoft.DotNet.Web.ProjectTemplates.3.1::3.1.10
dotnet new --install Microsoft.DotNet.Web.ProjectTemplates.3.1::3.1.10
Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp1.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\michaelw2.templateengine\dotnetcli\v5.0.100\scratch\restore.csproj]
Restored C:\Users\michaelw2.templateengine\dotnetcli\v5.0.100\scratch\restore.csproj (in 8.68 sec).Templates Short Name Language Tags
Console Application console [C#], F#, VB Common/Console
Class library classlib [C#], F#, VB Common/Library
WPF Application wpf [C#], VB Common/WPF
WPF Class library wpflib [C#], VB Common/WPF
WPF Custom Control Library wpfcustomcontrollib [C#], VB Common/WPF
WPF User Control Library wpfusercontrollib [C#], VB Common/WPF
Windows Forms App winforms [C#], VB Common/WinForms
Windows Forms Control Library winformscontrollib [C#], VB Common/WinForms
Windows Forms Class Library winformslib [C#], VB Common/WinForms
Worker Service worker [C#], F# Common/Worker/Web
Unit Test Project mstest [C#], F#, VB Test/MSTest
NUnit 3 Test Project nunit [C#], F#, VB Test/NUnit
NUnit 3 Test Item nunit-test [C#], F#, VB Test/NUnit
xUnit Test Project xunit [C#], F#, VB Test/xUnit
Razor Component razorcomponent [C#] Web/ASP.NET
Razor Page page [C#] Web/ASP.NET
MVC ViewImports viewimports [C#] Web/ASP.NET
MVC ViewStart viewstart [C#] Web/ASP.NET
Blazor Server App blazorserver [C#] Web/Blazor
Blazor (ASP.NET Core hosted) blazorhosted [C#] Web/Blazor/Hosted
Blazor Library blazorlib [C#] Web/Blazor/Library
Blazor (client-side) blazor [C#] Web/Blazor/Standalone
Blazor WebAssembly App blazorwasm [C#] Web/Blazor/WebAssembly
ASP.NET Core Empty web [C#], F# Web/Empty
ASP.NET Core Web App (Model-View-Controller) mvc [C#], F# Web/MVC
ASP.NET Core Web App webapp [C#] Web/MVC/Razor Pages
ASP.NET Core with Angular angular [C#] Web/MVC/SPA
ASP.NET Core with React.js react [C#] Web/MVC/SPA
ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA
Razor Class Library razorclasslib [C#] Web/Razor/Library
ASP.NET Core Web API webapi [C#], F# Web/WebAPI
ASP.NET Core gRPC Service grpc [C#] Web/gRPC
dotnet gitignore file gitignore Config
global.json file globaljson Config
NuGet Config nugetconfig Config
Dotnet local tool manifest file tool-manifest Config
Web Config webconfig Config
Solution File sln Solution
Protocol Buffer File proto Web/gRPCExamples:
dotnet new mvc --auth Individual
dotnet new xunit
dotnet new --help
dotnet new blazorserver --help
- Create Blazor app
dotnet new blazorserver -o BlazorApp
PS D:\BlazorApp> dotnet new blazorserver
The template "Blazor Server App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/5.0-third-party-notices for details.Processing post-creation actions...
Running 'dotnet restore' on D:\BlazorApp\BlazorApp.csproj...
Determining projects to restore...
Restored D:\BlazorApp\BlazorApp.csproj (in 67 ms).
Restore succeeded.
- Build and run app dotnet build
dotnet run
PS D:\BlazorApp> dotnet build
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.Determining projects to restore...
All projects are up-to-date for restore.
BlazorApp -> D:\BlazorApp\bin\Debug\net5.0\BlazorApp.dll
BlazorApp -> D:\BlazorApp\bin\Debug\net5.0\BlazorApp.Views.dllBuild succeeded.
0 Warning(s)
0 Error(s)Time Elapsed 00:00:09.00
PS D:\BlazorApp> dotnet run
Building...
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: D:\BlazorApp
If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Michael Wang