.NET – Create and Run a Simple ‘Hello World’ Web App

Tutorial: .NET – Create and Run a Simple ‘Hello World’ Web App

With the .NET CLI you can create a new project with the dotnet new <TEMPLATE> command, where the TEMPLATE is the type of application you want to create. To create a .NET Web App execute the command dotnet new web --name <NAME>, the NAME parameter sets the name of the .NET project and directory created, if omitted the name of the current directory is used.

The web template creates a simple Hello World .NET starter web application that contains some basic configuration and a single endpoint that returns the string "Hello World!" from the base path ("/").

Follow these steps to create a starter .NET web application named MyWebApp and open it in VS Code.

  1. Install the .NET SDK from https://dotnet.microsoft.com/download, which includes the .NET runtime and CLI
  2. Run the command dotnet new web --name MyWebApp to create a new web app named MyWebApp
  3. Navigate into the web app directory with the command cd MyWebApp
  4. Start the .NET web app with the command dotnet run
  5. Open the web app in a browser using the URL from the command output (Now listening on: http://localhost:[PORT NUMBER])

For more info on the dotnet new command see https://docs.microsoft.com/dotnet/core/tools/dotnet-new.

More Error Tutorials >>

Vue 3+VeeValidate – Form Validation Example (Composition API)

Vue 3+VeeValidate – Required Checkbox Example (Composition API)

Vue 3+Pinia-JWT Authentication Tutorial & Example

Leave a Reply

Your email address will not be published.