visual-studio - Visual Studio 2019 在哪里可以找到 .net core 3.1 的 WebAssembly 模板

标签 visual-studio blazor webassembly

我正在使用最新的(16.4.2,日期为 2020 年 1 月 8 日)Visual Studio 2019。

当我尝试创建 Blazor WebAssembly 解决方案时,尽管“blazor 应用程序”的描述包含“服务器或 WebAssembly”一词,但当我进入创建页面时,只有“服务器”选项可用,并且它成功创建了 Core 3.1 应用程序.

我认为会有最新版本,因此我访问了 Visual Studio 市场网站,但没有找到 Blazor 扩展,因此在互联网上查找时我发现正在运行以下命令:

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview2.19528.8

(通过 Missing visual studio 2019 blazor webassembly app template 找到)

它成功了,我得到了网络组装选项。然而,当我查看使用 WebAssembly 创建的项目时,它使用的是 .net Core 2.0,并且选项最多只有 2.1。我根据名称中的“3.1.0”部分推测它是最新的。

知道如何获取最新模板而不是随机搜索并使用 .net core 3.1 吗?

如果有更好的方法,谁能告诉我如何卸载模板,因为我没找到如何卸载模板。

最佳答案

在 CLI 中运行以下命令:“工具”->“Nuget 包管理器”->“包管理器控制台”:

dotnet new --install Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3

上面的 NuGet 包是 here .

开始使用 ASP.NET Core Blazor here .

关于visual-studio - Visual Studio 2019 在哪里可以找到 .net core 3.1 的 WebAssembly 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59668227/

相关文章:

asp.net-core - Blazor WebAssembly 将枚举作为参数传递给组件

emscripten - 在模块实例之间共享 WebAssembly.Memory

blazor - 如何将类成员数据绑定(bind)到 <a/> 或 Blazor 的 <NavLink/> 的 href 属性?

asp.net-core - Blazor Wasm PWA 未更新

c# - 如何从 Blazor WebAssembly 中的 Razor 页面访问 body 标签或其他标签?

windows - 在 MFC 中注册文件关联在 Windows 7 上不起作用

c# - 如何修复 : NUnit unit tests not showing up in testing pad in Visual Studio Community (Mac)

c# - 创建自定义任务按需缓存数据到html

c++ - 如何防止 Visual Studio 发出有关缺少调试信息的警告?

将 Blazor 中的对象记录到控制台