Closed RobSeder closed 5 years ago
This command
dotnet new -i Microsoft.AspNetCore.Blazor.Templates
is required if you want to use Blazor templates from command line. To see Blazor templates in VS you have to install Blazor Language Services. This is step number 1 in the doc: https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/blazor/get-started?view=aspnetcore-3.0&tabs=visual-studio
@Andrzej-W Thanks! I didn't catch that. I agree, after installing the extension the VS2019 side works as described.
Also though, that command:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates
That seems to do something, but also returns the "usage" help screen as if an incorrect variable was passed. FYI
Restoring packages for C:\Users\RobSe\.templateengine\dotnetcli\v3.0.100-preview-010184\scratch\restore.csproj...
Installing Microsoft.AspNetCore.Blazor.Templates 0.7.0.
Generating MSBuild file C:\Users\RobSe\.templateengine\dotnetcli\v3.0.100-preview-010184\scratch\obj\restore.csproj.nuget.g.props.
Generating MSBuild file C:\Users\RobSe\.templateengine\dotnetcli\v3.0.100-preview-010184\scratch\obj\restore.csproj.nuget.g.targets.
Restore completed in 3.32 sec for C:\Users\RobSe\.templateengine\dotnetcli\v3.0.100-preview-010184\scratch\restore.csproj.
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.
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#] Common/WPF
Windows Forms Application winforms [C#] Common/WinForms
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 Page page [C#] Web/ASP.NET
MVC ViewImports viewimports [C#] Web/ASP.NET
MVC ViewStart viewstart [C#] Web/ASP.NET
Blazor (hosted in ASP.NET server) blazorhosted [C#] Web/Blazor/Hosted
Blazor Library blazorlib [C#] Web/Blazor/Library
Blazor (Server-side in ASP.NET Core) blazorserverside [C#] Web/Blazor/ServerSide
Blazor (standalone) blazor [C#] Web/Blazor/Standalone
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 App (Razor Components) razorcomponents [C#] Web/RazorComponents
ASP.NET Core Web API webapi [C#], F# Web/WebAPI
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
Examples:
dotnet new mvc --auth Individual
dotnet new web
dotnet new --help
@RobSeder after running the initial command, you can then run dotnet new blazorserverside
(for example)
The project opens just fine in VS2019. Is this not the behavior you want?
@carlosrfernandez As noted above, it also produces a "usage" screen which makes it look like something was entered incorrectly.
Thanks for your help, @Andrzej-W
Describe the bug
Following the instructions from here: https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/blazor/get-started?view=aspnetcore-3.0&tabs=visual-studio using Windows 10 Pro (Version 10.0.17763.316) and VS2019 (Version 16.0.0 Preview 3.0) on 64-bit. From a VS2019 Developer Command Prompt, I run:
then, start a fresh instance of VS2019 and choose New ASP.NET Core Web Application, I see several templates, but nothing for Blazor.
To Reproduce
Steps to reproduce the behavior:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates
Expected behavior
Expected to see a Blazor template available.
Additional context
Uutput of
dotnet --info
: