liveBook · Manning

Empty web template

As explained in .NET in Action, Second Edition

An empty web template is a .NET project template that creates a minimal web application without extensive generated boilerplate.

An empty web template creates a minimal ASP.NET Core web application with little generated boilerplate. It supports building a web service using the minimal API style, making the initial setup nearly as direct as a console application. section 3.1

Create and run a service

Run `dotnet new web --name AsciiArtSvc`, enter the project directory, and execute `dotnet run`. The generated application listens on configured HTTP and HTTPS development ports and exposes a default root response of “Hello World!”.

The generated project uses `Microsoft.NET.Sdk.Web`; its `Program.cs` builds a `WebApplication`, maps endpoints, and runs the service. Unlike a fuller web API template, it leaves application behavior largely to the developer. section 3.1

Local development may require trusting the .NET development certificate. Launch profiles can open a browser and define application URLs; `dotnet run` starts the service without opening one. section 3.1

How .NET in Action, Second Edition covers it

How deep it goes
Demonstrates project creation, startup, endpoint mapping, ports, and certificates, but leaves most application behavior to implementation.
Examples
Uses the AsciiArtSvc project, a root Hello World endpoint, and an optional text endpoint rendered as ASCII art.
What it assumes
Assumes familiarity with .NET command-line usage and C# while demonstrating the web-service setup from the template onward.
What you can do after
Build it from scratch by generating, running, and extending a minimal ASP.NET Core web service.
How it connects
Connects minimal APIs with web services, launch profiles, development certificates, and HTTP endpoint routing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.