Scaffolding an ASP.NET Core MVC application using dotnet command
We all know that the dotnet new command will create a new console project containing a two files Program.cs and project.json out of the box for you
dotnet new
Output
It was of great help in getting started with a console application in .NET Core, but this command was missing a more important feature – the ability to create a ASP.NET Core Web project from the command line. So, we developers relied on scaffolding tools such as yeoman to generate Web/MVC/Web API projects targeting .NET Core. So whenever the .NET team made changes to the framework and tools, we faced some incompatibilities. Either we needed to wait till the template is upgraded to support the new changes or needed to manually update the files after the project is created.
This is now a thing of the past with the latest update to the .NET Core project implementing to facility to scaffold an MVC project targeting the Core framework.
Syntax
dotnet new –t web
Output
The process of building and running the web project remains the same by using the following statements
dotnet restore //restores the referenced packages
dotnet run //compiles the project if it’s not and then hosts the application in the default port 5000
No Comments
Connecting Azure Blob Storage account using Managed Identity
Posted 12/9/2022Securing Azure KeyVault connections using Managed Identity
Posted 11/26/2022Manage application settings with Azure KeyVault
Posted 11/9/2022Adding Serilog to Azure Functions created using .NET 5
Posted 4/3/2021Learn how to split log data into different tables using Serilog in ASP.NET Core
Posted 4/23/2020