c# - 我只看到项目模板 blazorserver,为什么我没有看到项目模板 blazor、blazorhosted、blazorlib、blazorserverside?
问题描述
命令
C:\Users\donhuvy>dotnet --version
3.0.100-preview8-013656
和
Microsoft Windows [Version 10.0.16299.1087]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\donhuvy>dotnet new --help
Usage: new [options]
Options:
-h, --help Displays help for this command.
-l, --list Lists templates containing the specified name. If no name is specified, lists all templates.
-n, --name The name for the output being created. If no name is specified, the name of the current directory is used.
-o, --output Location to place the generated output.
-i, --install Installs a source or a template pack.
-u, --uninstall Uninstalls a source or a template pack.
--nuget-source Specifies a NuGet source to use during install.
--type Filters templates based on available types. Predefined values are "project", "item" or "other".
--dry-run Displays a summary of what would happen if the given command line were run if it would result in a template creation.
--force Forces content to be generated even if it would change existing files.
-lang, --language Filters templates based on language and specifies the language of the template to create.
--update-check Check the currently installed template packs for updates.
--update-apply Check the currently installed template packs for update, and install the updates.
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 (WinForms) Application winforms [C#], VB Common/WinForms
Windows Forms (WinForms) Class library winformslib [C#], VB Common/WinForms
Worker Service worker [C#] 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
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/Razor Class 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/gRPC
Examples:
dotnet new mvc --auth Individual
dotnet new react --auth Individual
dotnet new --help
C:\Users\donhuvy>
当我阅读 Peter Himschoot 的“Blazor Revealed”一书时(https://www.apress.com/gp/book/9781484243428)
我只看到项目模板 blazorserver,为什么我没有看到项目模板 blazor、blazorhosted、blazorlib、blazorserverside?
甚至,当我使用 Visual Studio
Microsoft Visual Studio Community 2019 Preview
Version 16.3.0 Preview 2.0
VisualStudio.16.Preview/16.3.0-pre.2.0+29209.152
解决方案
客户端 Blazor 模板尚未内置到 ASP.NET Core,因为客户端 Blazor 尚未完全完成。这就是为什么您只会在列表中获得“Blazor Server App”模板的原因。
要开始客户端 Blazor 开发,首先需要安装模板。您可以通过运行以下命令来执行此操作,如“入门”文档中所述:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview8.19405.7
完成此操作后,模板应该可用,并且您可以使用dotnet new blazorwasm
.
推荐阅读
- django - 无法在 if 条件内解析 {{blog.content}}
- php - 在php中计算两个日期之间的特定天数
- java - 是否可以使用 MediaProjection API 并在录制过程中处理每个录制的帧?
- java - @Async API 端点 Spring Webflux
- python - 迭代两个列表中的每个值,然后将它们放入公式中
- javascript - 如何在无需对文件进行大量更改的情况下将 JavaScript 对象的所有函数导出为模块?
- java - 使用 Spring Boot 隐式服务 index.html
- apache - 使用 mod_substitute 替换 httpd 中 html 响应中的 head 部分
- python - 如何使一个曲面通过四个点并找到相邻点在曲面上的投影
- php - DICOM 工作列表在 DCMTK wlmscpfs 中返回不匹配