3.1 KiB
title | author | description | manager | ms.author | ms.date | ms.prod | ms.technology | ms.topic | uid |
---|---|---|---|---|---|---|---|---|---|
Get Started with ASP.NET Core | rick-anderson | A quick tutorial that creates and runs a simple Hello World app using ASP.NET Core. | wpickett | riande | 10/18/2017 | asp.net-core | aspnet | get-started-article | getting-started |
Get Started with ASP.NET Core
::: moniker range=">= aspnetcore-2.0"
-
Create a new .NET Core project.
On macOS and Linux, open a terminal window. On Windows, open a command prompt. Enter the following command:
dotnet new razor -o aspnetcoreapp
-
Run the app.
Use the following commands to run the app:
cd aspnetcoreapp dotnet run
-
Browse to http://localhost:5000
-
Open Pages/About.cshtml and modify the page to display the message "Hello, world! The time on the server is @DateTime.Now ":
-
Browse to http://localhost:5000/About and verify the changes.
Next steps
For getting-started tutorials, see ASP.NET Core Tutorials
For an introduction to ASP.NET Core concepts and architecture, see ASP.NET Core Introduction and ASP.NET Core Fundamentals.
An ASP.NET Core app can use the .NET Core or .NET Framework Base Class Library and runtime. For more information, see Choosing between .NET Core and .NET Framework.
::: moniker-end
::: moniker range=">= aspnetcore-1.0"
-
Install the .NET Core SDK Installer for SDK 1.0.4 from the .NET Core All Downloads page.
-
Create a folder for a new .NET Core project.
On macOS and Linux, open a terminal window. On Windows, open a command prompt.
mkdir aspnetcoreapp cd aspnetcoreapp
-
If you have installed a later SDK version on your machine, create a global.json file to select the 1.0.4 SDK.
{ "sdk": { "version": "1.0.4" } }
-
Create a new .NET Core project.
dotnet new web
-
Restore the packages.
dotnet restore
-
Run the app.
The dotnet run command builds the app first if needed.
dotnet run
-
Browse to
http://localhost:5000
Next steps
For getting-started tutorials, see ASP.NET Core Tutorials
For an introduction to ASP.NET Core concepts and architecture, see ASP.NET Core Introduction and ASP.NET Core Fundamentals.
An ASP.NET Core app can use the .NET Core or .NET Framework Base Class Library and runtime. For more information, see Choosing between .NET Core and .NET Framework.
::: moniker-end