Quickstart: Use Visual Studio to create your first ASP.NET Core web app
In this 5-10 minute introduction to how to use Visual Studio, you'll create a simple "Hello World" web app by using an ASP.NET project template and the C# programming language.
If you haven't already installed Visual Studio, go to the Visual Studio downloads page to install it for free.
Create a project
First, you'll create an ASP.NET Core web application project. The project type comes with all template files to create a web app, before you've even added anything!
Open Visual Studio 2017.
From the top menu bar, choose File > New > Project.
In the left pane of the New Project dialog box, expand Visual C#, and then choose .NET Core. In the middle pane, choose ASP.NET Core Web Application. Then, name your file
HelloWorldand choose OK.
If you don't see the .NET Core project template category, choose the Open Visual Studio Installer link in the left pane.
The Visual Studio Installer launches. Choose the ASP.NET and web development workload, and then choose Modify.
(You might have to close Visual Studio before you can continue installing the new workload.)
In the New ASP.NET Core Web Application dialog box, verify that ASP.NET Core 2.0 appears in the top drop-down menu. Then, choose Web Application and choose OK.
Soon after, Visual Studio opens your project file.
Create the app
In the Solution Explorer, expand the Pages folder, and then choose About.cshtml.
This file corresponds to a page that's named About in the web app.
In the editor, you'll see HTML code for the "additional information" area of the About page.
Change the "additional information" text to read "Hello World!".
In the Solution Explorer, expand About.cshtml, and then choose About.cshtml.cs. (This file also corresponds with the About page in your web app.)
In the editor, you'll see C# code that includes text for the "application description" area of the About page.
Change the "application description" message text to read "What's my message?".
Run the app
Press Ctrl+F5 to run the app and open it in a web browser.
If you get an error message that says, Unable to connect to web server 'IIS Express', close Visual Studio and then open it by using the Run as administrator option from the right-click or context menu. Then, run the application again.
At the top of the web page, choose About.
View the updated text that you added to the About page.
Close the web browser.
Congratulations on completing this Quickstart! We hope you learned a little bit about C#, ASP.NET Core, and the Visual Studio IDE (integrated development environment).
To learn more, continue with the following tutorial: