Getting started with ASP. NET Core MVC and Visual Studio
vs. Getting started with ASP. NET Core MVC
2017-3-7 2 min to read
Content of this article
1.Install Visual Studio and. NET Core
Install VS. NET Core
2.Create a web App
Create a web App
by Rick Anderson
This tutorial would teach you the basics of building an ASP. NET Core MVC web App using Visual Studio 2017.
This tutorial will teach you how to create a basic ASP. NET core MVC application using VS2017
There is 3 versions of this tutorial:
In addition, there are three other versions of the tutorials (self-translation):
- Macos:create an ASP. NET Core MVC app with Visual Studio for Mac
- Windows:create an ASP. NET Core MVC app with Visual Studio
- MacOS, Linux, and windows:create an ASP. NET Core MVC app with Visual Studio Code
For the Visual Studio version of this tutorial, see the VS. version of ASP. NET Core documentation in PDF format.
Install Visual Studio and. NET Core
Install vs. NET Core
Install Visual Studio Community 2017. Select the Community download. Skip This step if you have Visual Studio installed.
Install vs 2017 Community edition. Select the Community edition download. If you have already installed, you can skip this step.
- Visual Studio Home Page Installer
Run the installer and select the following workloads:
To run this installation package, select the following work item:
- ASP. NET and Web development (Under Web & Cloud)
An environment that needs to be checked
- . NET Core cross-platform Development (under Other toolsets)
Need to check the environment two
Create a web App
Create a web App
From Visual Studio, select File > New > Project.
In VS, select the File > New > Project menu, new.
Complete the New Project Dialog:
Complete the New Project dialog box:
- In the left pane, tap . NET Core
In the left pane, click. NET Core
- In the center pane, tap ASP Core WEB application (. NET core)
In the middle pane, click ASP. NET Core WEB Application
- Name the project "Mvcmovie" (It's important to name the project "Mvcmovie" If you copy code, the namespace would
Named Project name is Mvcmovie
Match.)
Click OK
Complete the New net Core Web application (. NET core)-Mvcmovie Dialog:
Complete the New ASP. NET Core WEB Application-mvcmovie dialog box:
- In the version selector Drop-down box tap ASP 1.1
Select the ASP. NET Core 1.1 option in the version selection drop-down box
Click Web Application
- Keep The default No authentication
Keep the default No authentication selection
Click OK
Visual Studio used a default template for the MVC project just created. You had a working app right now by entering a project
VS uses a default project template. After you type the project name and select a few options, you have a web app that works correctly.
Name and selecting a few options. This was a simple starter project, and it's a good place to start,
It's a simple starter project, and it's a good starting point,
Tap F5 to run the app in debug mode or ctrl-f5 in non-debug mode.
Click F5 to start the program in debug mode, or Ctrl+f5 run the program in non-debug mode.
- Visual Studio starts IIS Express and runs your app. Notice that address bar shows localhost:port# and not something
VS Startup IIS Express is used to run your app. Note that the browser's address bar shows Ip+port, not a common domain name.
Like example.com. That's because localhost is the standard hostname for your local computer. When Visual Studio creates
This is because localhost is the standard host name for your native computer. When vs creates a new Web project,
A Web project, a random port is used for the Web server. In the image above, the port number is 5000. When you run the app,
A random port is selected for use by the Web server. In, the port is 5000. When you run the app yourself,
You'll see a different port number.
You may see a different port.
- Launching the app with ctrl+f5 (non-debug mode) allows your to make code changes, save the file, refresh the brows Er, and
Launching the app in non-debug mode allows you to make some code changes, save the file, refresh the browser, and
See the code changes. Many developers prefer to use Non-debug mode to quickly launch the app and view changes.
View the changes. Many developers prefer to use non-debug mode to quickly launch apps and see changes.
- You can launch the app in Debug or Non-debug mode from the debug menu item:
You can start your app in debug menu or non-debug mode:
- You can debug the app by tapping the IIS Express button
You can start the debugger by clicking the IIS Express button
The default template gives working Home, about and contact links. The browser image above doesn ' t show these links.
The default template provides Home, about and a contact three links with the page. These links are not displayed in the browser.
Depending on the size of your browser, you might need to click the navigation icon to show them.
Because depending on your browser's width size, you may need to click the navigation icon to display them.
If you were running in debug mode, tap shift-f5 to stop debugging.
If you are running in debug mode, click shift-f5 to stop debugging.
In the next part of this tutorial, we'll learn about MVC and start writing some code.
In the next tutorial, we will begin to learn about MVC and how to start writing some code.
Mask
2017-07-12 11:05 Wednesday
005.Getting started with ASP. NET core MVC and Visual Studio--"vs. developing ASP. NET Core MVC"