### Ubuntu Setup and Manpage Update Source: https://github.com/dotnet/sdk/blob/main/documentation/manpages/tool/README.md This example demonstrates how to set up a clean Ubuntu environment by installing necessary packages like python, pandoc, and git, and then cloning the .NET CLI repository to run the manpage update tool. It includes fetching the latest pandoc release. ```shell apt update apt install -y jq curl python python-pip wget unzip git < /dev/null pip install pandocfilters pandocVersion=$(curl -s https://api.github.com/repos/jgm/pandoc/releases/latest | jq -r ".tag_name") pandocVersionedName="pandoc-$pandocVersion-1-amd64.deb" curl -sLO https://github.com/jgm/pandoc/releases/download/$pandocVersion/$pandocVersionedName > /dev/null dpkg -i $pandocVersionedName rm $pandocVersionedName* git clone https://github.com/dotnet/cli ./cli/Documentation/manpages/tool/update-man-pages.sh ``` -------------------------------- ### One-liner installation scripts Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/cli-installation-scenarios.md Commands to download and execute the installation scripts directly from the web for quick setup. ```powershell @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) " ``` ```bash curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin ``` -------------------------------- ### Manual Action Example Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Post-Action-Registry.md An example of a manual action configuration, likely for setup or post-build tasks. ```json "postActions": [{ "description": "Manual actions required", "manualInstructions": [{ "text": "Run the following command" }], "actionId": "AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C", "args": { "executable": "setup.cmd", "args": "" }, "continueOnError": true }] ``` -------------------------------- ### Install Prism Forms QuickStarts Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install Prism for Xamarin Forms project templates. Requires dotnet cli 2.0 pre3+. ```bash dotnet new install "Prism.Forms.QuickstartTemplates" ``` -------------------------------- ### Example .NET CLI Completion Output Source: https://github.com/dotnet/sdk/blob/main/documentation/general/tab-completion.md This output indicates that your .NET CLI installation is correctly set up to provide tab completion suggestions. ```text --help package ``` -------------------------------- ### Install Auth0 Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the Auth0 templates for .NET. ```bash dotnet new install Auth0.Templates ``` -------------------------------- ### Install GCC.Build Template Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the GCC.Build template for C/C++/CPP/VCXPROJ builds. ```bash dotnet new install GCC.Build.Template ``` -------------------------------- ### Install .NET Boxed Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the .NET Boxed templates. ```bash dotnet new install "Boxed.Templates" ``` -------------------------------- ### Install cloudscribe Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the cloudscribe templates. ```bash dotnet new install "cloudscribe.templates" ``` -------------------------------- ### Install IdentityServer4 Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the IdentityServer4 templates. ```bash dotnet new install "identityserver4.templates" ``` -------------------------------- ### Install Cake.Frosting Template Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the Cake.Frosting template for build automation. ```bash dotnet new install "Cake.Frosting.Template" ``` -------------------------------- ### Template Verifier Setup Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/authoring-tools/Templates-Testing-Tooling.md Instructions on how to add the Template Verifier package reference and start using it in your tests. ```APIDOC ## Setup 1. Add the package reference to `Microsoft.TemplateEngine.Authoring.TemplateVerifier`: ```dotnetcli dotnet add package Microsoft.TemplateEngine.Authoring.TemplateVerifier ``` 2. Start using the `TemplateVerifier` in your tests: ```cs using Microsoft.TemplateEngine.Authoring.TemplateVerifier; namespace MyTests [TestClass] public class MyTestClass { [TestMethod] public async Task MyTemplate_InstantiationTest() { TemplateVerifierOptions options = new(templateName: templateShortName) { TemplateSpecificArgs = new[] { "--arg1", "true" }, }; VerificationEngine engine = new(_logger); await engine.Execute(options).ConfigureAwait(false); } } ``` ``` -------------------------------- ### Install ServiceStack Core Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the ServiceStack .NET Core templates. ```bash dotnet new install "ServiceStack.Core.Templates" ``` -------------------------------- ### Install SpecFlow Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the SpecFlow.Templates.DotNet for creating executable specifications with SpecFlow. ```bash dotnet new install "SpecFlow.Templates.DotNet" ``` -------------------------------- ### Install NSpec Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the NSpec templates for .NET. ```bash dotnet new install "dotnet-new-nspec" ``` -------------------------------- ### Install Eto.Forms Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the Eto.Forms templates for cross-platform UI development. ```bash dotnet new install "Eto.Forms.Templates" ``` -------------------------------- ### Install Particular Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install Particular Software templates for NServiceBus and other tools. ```bash dotnet new install "ParticularTemplates" ``` -------------------------------- ### Install Kentico Cloud Boilerplate Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the Kentico Cloud Boilerplate template for .NET. ```bash dotnet new install "KenticoCloud.CloudBoilerplateNet" ``` -------------------------------- ### Install MSBuild Extension Template Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the MSBuild extension template. ```bash dotnet new install "MSBuildExtensionTemplate" ``` -------------------------------- ### Install GtkSharp Template Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the GtkSharp template for C# applications. ```bash dotnet new install "GtkSharp.Template.CSharp" ``` -------------------------------- ### Install NUnit 3 Test Project Template Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the NUnit 3 test project template. ```bash dotnet new install "NUnit3.DotNetNew.Template" ``` -------------------------------- ### Create and Build a .NET Class Library Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/canonical.md Demonstrates initializing a new class library project, restoring dependencies, and compiling the code into a DLL. ```bash dotnet new mylib --type lib dotnet restore dotnet build ``` ```csharp namespace mylib { public class mylib { public void Method1() { } } } ``` -------------------------------- ### Publish .NET Application Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/canonical.md Demonstrates how to publish an application for deployment and execute the resulting DLL. ```bash dotnet publish --output /pubapp cd /pubapp/myapp dotnet ./myapp.dll ``` -------------------------------- ### Manage Dependencies and Run Application Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/canonical.md Shows how to install a NuGet package, use it within the application code, and execute the application. ```bash dotnet pkg install Newtonsoft.Json --version 8.0.2 dotnet run ``` ```csharp using Newtonsoft.Json; namespace myapp { public static class Program { public static void Main(string[] args) { var thing = JsonConvert.DeserializeObject("{ 'item': 1 }"); Console.WriteLine("Hello, World!"); Console.WriteLine(thing.item); } } } ``` -------------------------------- ### C# Shebang Example Source: https://github.com/dotnet/sdk/blob/main/documentation/general/dotnet-run-file.md This is an example of a C# file starting with a shebang line, which is ignored by the C# compiler but can be used by the system to interpret the file. ```cs #!/usr/bin/env dotnet Console.WriteLine("Hello"); ``` -------------------------------- ### Create and Run a Simple Console Application Source: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md Demonstrates creating a new console application and running it using the `dotnet` CLI. This should output 'Hello World!'. ```shell mkdir test cd test dotnet new console dotnet run ``` -------------------------------- ### Dotnet CLI: Template Management Operation Failed Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Exit-Codes.md This example demonstrates an error during template installation, specifically when no NuGet sources are defined or enabled. ```console >dotnet nuget disable source nuget.org Package source with Name: nuget.org disabled successfully. > dotnet new install webapi2 The following template packages will be installed: webapi2 Error: No NuGet sources are defined or enabled. webapi2 could not be installed, the package does not exist. For details on current exit code please visit https://aka.ms/templating-exit-codes#106 ``` -------------------------------- ### Setup Tools Manifest File with dotnet CLI Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/authoring-tools/Templates-Testing-Tooling.md Initialize a tools manifest file in your project if one does not already exist. This is a prerequisite for installing local tool packages. ```dotnetcli dotnet new tool-manifest ``` -------------------------------- ### Installer Interface and Operations Source: https://github.com/dotnet/sdk/blob/main/src/TemplateEngine/Microsoft.TemplateEngine.Abstractions/PublicAPI.Shipped.txt Defines the contract for template package installers, including installation, uninstallation, and update operations. ```APIDOC ## Installer Operations ### Description Manages the installation, uninstallation, and updating of template packages. ### Interfaces #### IInstaller - `CanInstallAsync(InstallRequest installationRequest, CancellationToken cancellationToken)`: Checks if a package can be installed. - `GetLatestVersionAsync(IEnumerable templatePackages, IManagedTemplatePackageProvider provider, CancellationToken cancellationToken)`: Retrieves the latest available versions for given template packages. - `InstallAsync(InstallRequest installRequest, IManagedTemplatePackageProvider provider, CancellationToken cancellationToken)`: Installs a template package. - `UninstallAsync(IManagedTemplatePackage templatePackage, IManagedTemplatePackageProvider provider, CancellationToken cancellationToken)`: Uninstalls a template package. - `UpdateAsync(UpdateRequest updateRequest, IManagedTemplatePackageProvider provider, CancellationToken cancellationToken)`: Updates a template package. #### IInstallerFactory - `CreateInstaller(IEngineEnvironmentSettings settings, string installPath)`: Creates an instance of an installer. - `Name` (get): Gets the name of the installer factory. #### InstallerOperationResult - `ErrorMessage` (get): Gets the error message if an operation failed. - `InstallerOperationResult(InstallerErrorCode error, string? errorMessage, IManagedTemplatePackage? templatePackage = null)`: Constructor for failed operations. - `InstallerOperationResult(IManagedTemplatePackage managedTemplatePackage)`: Constructor for successful operations. ``` -------------------------------- ### Install CLI to custom directory Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/cli-installation-scenarios.md Installs the .NET CLI to a user-defined installation path. Useful for isolated environments or specific project requirements. ```powershell ./dotnet-install.ps1 -Channel Current -InstallDir C:\cli ``` ```bash ./dotnet-install.sh --channel Current --install-dir ~/cli ``` -------------------------------- ### Install Template Packages with Force Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewInstallTests.CannotInstallMultiplePackageAvailableFromBuiltIns.verified.txt Use the '--force' option to install template packages even if they are already available. This is useful for overriding existing installations. ```bash dotnet new install Microsoft.DotNet.Common.ItemTemplates@6.0.100 Microsoft.DotNet.Web.ItemTemplates@5.0.0 --force ``` -------------------------------- ### Build .NET SDK on Windows Source: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md Run this command from the root of the repository to build the .NET SDK on Windows. The output includes a local dotnet installation. ```bash build.cmd ``` -------------------------------- ### Installer Constants Source: https://github.com/dotnet/sdk/blob/main/src/TemplateEngine/Microsoft.TemplateEngine.Abstractions/PublicAPI.Shipped.txt Constants used in the template engine installer. ```APIDOC ## Constants: InstallerConstants ### Description Contains constants used by the template engine installer. ### Fields - **InteractiveModeKey**: string - Key for interactive mode. - **NuGetSourcesKey**: string - Key for NuGet sources. ``` -------------------------------- ### Install AWS Lambda .NET Core Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install the AWS Lambda .NET Core templates. ```bash dotnet new install "Amazon.Lambda.Templates" ``` -------------------------------- ### Build, Test, and Package a Library Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/canonical.md Workflow for ensuring library code quality by building, running unit tests, and creating a NuGet package. ```bash dotnet build dotnet test dotnet pack ``` -------------------------------- ### Force Install Template Package Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewInstallTests.CannotInstallPackageAvailableFromBuiltIns.verified.txt Use the '--force' option to install a template package even if a version is already available. This is useful for overriding existing installations. ```bash dotnet new install Microsoft.DotNet.Common.ItemTemplates@6.0.100 --force ``` -------------------------------- ### dotnet new install Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewHelpTests.CanShowHelp_common.verified.txt Installs a template package from a NuGet feed. ```APIDOC ## POST /dotnet/new/install ### Description Installs a template package from a NuGet feed. ### Method POST ### Endpoint /dotnet/new/install ### Parameters #### Path Parameters - **package** (string) - Required - The name or path of the template package to install. #### Query Parameters - **-v, --verbosity** (string) - Optional - Sets the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], and diag[nostic]. [default: normal] - **-?, -h, --help** (boolean) - Optional - Show command line help. ### Request Example ```json { "package": "Microsoft.AspNetCore.SpaTemplates::2.0.0" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of the installation. #### Response Example ```json { "message": "Template package 'Microsoft.AspNetCore.SpaTemplates::2.0.0' installed successfully." } ``` ``` -------------------------------- ### Setup Test Environment on Windows Source: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md Run this command from the repository root to set up a test environment on Windows. This configures PowerShell to redirect SDK resolution to your build artifacts. ```shell eng\dogfood.cmd ``` -------------------------------- ### List All Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/template-resolution-for-dotnet-cli.md Lists all available templates. This is the base command for viewing installed templates. ```bash dotnet new list ``` -------------------------------- ### Setup Test Environment on Linux/macOS Source: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md Run this command from the repository root to set up a test environment on Linux or macOS. This configures your shell to redirect SDK resolution to your build artifacts. ```shell source ./eng/dogfood.sh ``` -------------------------------- ### List Installed Templates Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewTests.CanShowBasicInfo.Linux.verified.txt Display all project templates currently installed on your system. ```bash dotnet new list ``` -------------------------------- ### Listing Installed Templates Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewDebugOptionsTests.CanShowConfigWithDebugShowConfig.Windows.verified.txt View all project templates currently installed on your system. ```APIDOC ## GET /api/templates/list ### Description Lists all the project templates that are currently installed on the system. ### Method GET ### Endpoint dotnet new list ### Parameters None ### Request Example ```bash dotnet new list ``` ### Response #### Success Response (200) - **Template List** (array) - A list of installed templates with their names, short names, languages, and tags. #### Response Example ```json [ { "Template Name": "Blazor Web App", "Short Name": "blazor", "Language": "[C#]", "Tags": "Web/Blazor/WebAssembly" }, { "Template Name": "Class Library", "Short Name": "classlib", "Language": "[C#],F#,VB", "Tags": "Common/Library" } ] ``` ``` -------------------------------- ### Installer Factory Constructors Source: https://github.com/dotnet/sdk/blob/main/src/TemplateEngine/Microsoft.TemplateEngine.Edge/PublicAPI.Shipped.txt Initializes factory classes for different types of installers. ```APIDOC ## Installer Factory Constructors ### Description These constructors initialize factory classes responsible for creating different types of installers. ### Classes and Constructors #### FolderInstallerFactory - **Constructor**: `FolderInstallerFactory()` - **Description**: Initializes the Folder Installer Factory. #### NuGetInstallerFactory - **Constructor**: `NuGetInstallerFactory()` - **Description**: Initializes the NuGet Installer Factory. ``` -------------------------------- ### Create .NET Project from Template Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewUninstallTests.CanShowMessageInCaseShortNameConflict.verified.txt Shows how to create a new project instance from a specific .NET template. This command requires the template's short name and is useful for quickly scaffolding new projects based on predefined structures. ```bash dotnet new create uninstall ``` -------------------------------- ### Display Manual Instructions Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Post-Action-Registry.md Prints manual instructions and the actual command to be executed. This is useful for providing user guidance after template instantiation. ```json "postActions": [{ "description": "Add projects to solution", "manualInstructions": [ { "text": "Add generated project to solution manually." } ], "args": { "solutionFolder": "src" }, "actionId": "D396686C-DE0E-4DE6-906D-291CD29FC5DE", "continueOnError": true }] ``` -------------------------------- ### Build .NET SDK on Linux and macOS Source: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md Execute this command from the root of the repository to build the .NET SDK on Linux or macOS. A local .NET Core installation will be generated. ```bash ./build.sh ``` -------------------------------- ### dotnet new update Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewHelpTests.CanShowHelp_common.verified.txt Checks for and installs updates for currently installed template packages. ```APIDOC ## POST /dotnet/new/update ### Description Checks the currently installed template packages for updates and installs any available updates. ### Method POST ### Endpoint /dotnet/new/update ### Parameters #### Query Parameters - **-v, --verbosity** (string) - Optional - Sets the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], and diag[nostic]. [default: normal] - **-?, -h, --help** (boolean) - Optional - Show command line help. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Status message indicating the result of the update check. #### Response Example ```json { "message": "Template packages updated successfully." } ``` ``` -------------------------------- ### Install Request Path Resolution Source: https://github.com/dotnet/sdk/blob/main/src/TemplateEngine/Microsoft.TemplateEngine.Utils/PublicAPI.Shipped.txt Utilities for resolving paths related to template installation. ```APIDOC ## Install Request Path Resolution ### Description Provides utility methods for expanding masked paths used in install requests. ### Methods - **ExpandMaskedPath**: Expands a masked path using the provided environment settings. ### Parameters #### Path Parameters - **maskedPath** (string) - Required - The path containing masks to be expanded. - **environmentSettings** (IEngineEnvironmentSettings) - Required - The environment settings to use for expansion. ### Usage Example ```csharp // Assuming environmentSettings is an instance of IEngineEnvironmentSettings var expandedPaths = InstallRequestPathResolution.ExpandMaskedPath("~/templates/*", environmentSettings); ``` ``` -------------------------------- ### Build and Publish Container Image with .NET SDK Source: https://github.com/dotnet/sdk/blob/main/src/Containers/packaging/README.md Demonstrates the commands to add the .NET SDK Containers package and publish a container image. It specifies the target operating system and architecture, and uses the `DefaultContainer` PublishProfile. The output indicates the successful push to a registry. ```shell dotnet add package Microsoft.NET.Build.Containers dotnet publish --os linux --arch x64 -p:PublishProfile=DefaultContainer ... Pushed container ':' to registry 'docker://' ... ``` -------------------------------- ### Installer Error Codes Source: https://github.com/dotnet/sdk/blob/main/src/TemplateEngine/Microsoft.TemplateEngine.Abstractions/PublicAPI.Shipped.txt Enumerates possible error codes that can occur during installer operations. ```APIDOC ## Enum: InstallerErrorCode ### Description Defines the possible error codes for installer operations. ### Members - **Success** (0) - Indicates a successful operation. - **PackageNotFound** (1) - Indicates that the requested package could not be found. - **InvalidSource** (2) - Indicates that the provided source is invalid. - **DownloadFailed** (3) - Indicates that the package download failed. - **UnsupportedRequest** (4) - Indicates that the request is not supported. - **GenericError** (5) - Indicates a general error occurred. - **AlreadyInstalled** (6) - Indicates that the package is already installed. - **UpdateUninstallFailed** (7) - Indicates that the update or uninstall operation failed. - **InvalidPackage** (8) - Indicates that the package is invalid. ``` -------------------------------- ### Create Project from Template Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewUninstallTests.CanShowMessageInCaseShortNameConflict.verified.txt Demonstrates how to create a new project using a template with a specified short name. ```APIDOC ## Create Project from Template ### Description Creates a new project based on a template using its short name. ### Method CLI Command ### Endpoint N/A ### Parameters - **create** (command) - Required - The command to create a new project. - **[TEMPLATE SHORT NAME]** (string) - Required - The short name of the template to use. ### Request Example ```bash dotnet new create uninstall ``` ### Response Creates a new project directory with the files generated from the specified template. ``` -------------------------------- ### Run .NET MAUI Project in Unpackaged Mode Source: https://github.com/dotnet/sdk/blob/main/documentation/specs/dotnet-run-for-maui.md Demonstrates running a .NET MAUI project using `dotnet run` in unpackaged mode for WindowsAppSDK. This relies on the default launch profile in `launchSettings.json`. ```bash > dotnet run -f net10.0-windows10.0.19041.0 Using launch settings from D:\src\hellomaui\Properties\launchSettings.json... ``` -------------------------------- ### Display Template Help and Available Templates Source: https://github.com/dotnet/sdk/blob/main/test/dotnet-new.IntegrationTests/Approvals/DotnetNewDebugOptionsTests.CanShowConfigWithDebugShowConfig.Linux.verified.txt Commands to inspect template options and list all installed templates. These are useful for discovering available project types and their specific configuration flags. ```bash dotnet new console -h dotnet new list dotnet new search web ``` -------------------------------- ### List Installed .NET Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use `dotnet new list` to display templates installed on your machine, including those pre-installed with the SDK and manually installed ones. You can filter the list by name, type, or author. ```bash dotnet new list ``` ```bash dotnet new list --author Microsoft ``` ```bash dotnet new list web ``` ```bash dotnet new list web --type project ``` -------------------------------- ### Install Blazor Templates Source: https://github.com/dotnet/sdk/blob/main/documentation/TemplateEngine/Available-templates-for-dotnet-new.md Use this command to install Blazor templates for full-stack web development with C# and WebAssembly. Specify a version if needed. ```bash dotnet new install "Microsoft.AspNetCore.Blazor.Templates::3.0.0-*" ```