Using the command line
With .NET 5, you get a super powerful tool called dotnet.exe
. Developers that have used .NET Core before will already be familiar with the tool, but with .NET 5, it is no longer exclusively for .NET Core developers.
It can do a lot of the things Visual Studio can do, for example, creating projects, adding and creating NuGet packages, and much more. In the next example, we will create a Blazor Server.
Creating projects using the command line
The following steps are just for demonstrating the power of using the command line. We will not use this project later in the book, so if you don't want to try it, go ahead and skip this section. To create a solution with Blazor server and Blazor WebAssembly projects like the one we just did we can run this command:
dotnet new blazorserver -o BlazorServer
dotnet new blazorwasm -o BlazorWebAssembly --pwa –hosted
Here, dotnet
is the command, and to create a new project, we use the new
parameter.
blazorserver
is the...