Preparing Windows for ASP.NET Core Development

Important It is very important to prepare your Windows properly for developing ASP.NET Core. Please read and follow the instructions completely and carefully.

To prepare your Windows for ASP.NET Core, you must install all the components required to build and run ASP.NET Core web applications, including .NET Core SDK. See System Requirements for details.

 

Step 1 - Testing .NET Core SDK

Open command prompt, initialize a sample Hello World application, enter:

mkdir hwapp

cd hwapp

dotnet new

Run the application, enter:

dotnet restore

dotnet run

The first command will restore the packages specified in the project.json or .csproj file, and the second command will run the actual sample.

If you see the output "Hello World!":

then you're set. You now have .NET Core running on your machine, please proceed to testing ASP.NET Core with Visual Studio as follows.

 

Step 2 - Testing with Visual Studio Community 2015/ 2017

With Visual Studio Community, you can develop and test ASP.NET Core web applications easily. Visual Studio Community is free, you can download it from https://www.visualstudio.com/products/visual-studio-community-vs.

After installing Visual Studio Community, test it as follows.

Create a web application, from the Visual Studio Start page, tap New Project.

images/new_project.png

 

Alternatively, you can use the menus to create a new project. Tap File > New > Project.

images/alt_new_project.png

 

Complete the New Project dialog:

  • In the left pane, tap Web
  • In the center pane, tap ASP.NET Core Web Application (.NET Framework)
  • Name the project “MvcMovie” (It’s important to name the project “MvcMovie” so when you copy code, the namespace will match. )
  • Tap OK
Note Make sure you choose ASP.NET Core Web Application (.NET Framework), the other two, namely, ASP.NET Web Application (.NET Framework) and ASP.NET Core Web Application (.NET Core) are NOT supported by ASP.NET Maker.
images/new_project2.png

 

In the New ASP.NET Core Web Application - MvcMovie dialog, tap Web Application.

Tap Change Authentication and set it to No Authentication, tap OK.

images/p3.png

 

 

Tap OK again to create the project.

Visual Studio used a default template for the MVC project you just created, so you have a working app right now by entering a project name and selecting a few options. This is a simple "Hello World" project, and it's a good place to start,

Tap F5 to run the app in debug mode or Ctl-F5 in non-debug mode.

images/12.png

 

  • Visual Studio starts IIS Express and runs your app. Notice that the address bar shows localhost:port# and not something like example.com. That’s because localhost always points to your own local computer, which in this case is running the app you just created. When Visual Studio creates a web project, a random port is used for the web server. In the image above, the port number is 1234. When you run the app, you’ll see a different port number.
  • Launching the app with Ctrl+F5 (non-debug mode) allows you to make 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.
  • You can launch the app in debug or non-debug mode from the Debug menu item:
images/debug_menu.png

  • You can debug the app by tapping the IIS Express button
images/iis_express.png

The default template gives you working Home, Contact, About, Register and Log in links. The browser image above doesn’t show theses links. Depending on the size of your browser, you might need to click the navigation icon to show them.

images/2.png

 

If everything works, you can try your first ASP.NET Maker web application by following Quick Start.

 

 

 ©2004-2017 e.World Technology Ltd. All rights reserved.