Install and create
Install the supported .NET SDK, then:
dotnet new webapp -n PicnicRazor
cd PicnicRazor
dotnet runOpen the exact local URL printed by your terminal.
Explore files
Pages/Index.cshtml contains markup and Razor. Pages/Index.cshtml.cs contains the C# PageModel. Shared/_Layout.cshtml is a common layout; wwwroot contains static files.
Edit Index.cshtml
@page
@model IndexModel
<h1>My first Razor website</h1>
<p>Today is @DateTime.Now.ToString("dddd")</p>Keep the matching generated Index.cshtml.cs file. Refresh after saving.