ASP.NET Core New Project (Windows)

For any language and framework, are from the beginning of Hello World, this is very simple, but it has great significance, ASP.NET Core based tutorial will start at Hello World

why?

Hello World being able to run successfully, that means before we configured the environment is successful, or we need is to configure fail

Creating a Hello World Web project

  1. Double-click the icon to open the Visual Studio Visual Studio, and then select the menu bar File -> New -> Project Open dialog box, select the template for the new project

  2. New Project dialog box, select the template for the three columns, the left is the project classification, the middle is the specific project templates, the right is the description of the template

  3. In the New Project dialog box, select a template, you can see on the left lists the templates of various solutions, we chose Visual C # under the .NET Core

  4. Select the .NET Core after the right appears .NET Core applications solutions list and language selection list

    When an election in one of the most appropriate description appears on the right

    A first IDE universe really is not covered ..

  5. Select the ASP.NET Core Web application , and then start typing the name of the project HelloWorld

    Enter the project name in the HelloWorld , Visual Studio will automatically enter the name of the solution

  6. Click OK to enter .NET Core template selection dialog

    There are many templates to choose from, click each template, the appropriate instructions will appear on the right

  7. Because the purpose of teaching, the target framework, we chose the .NET Core 2.1

  8. Then select empty , because the structure so that we can better understand ASP.NET Core project into the project configuration dialog

  9. Check the bottom configured to HTTPS

  10. Click the lower right corner is determined, it will generate a HelloWorld project

This creates a file called the HelloWorld ASP.NET 2.1 Core Project

Running the Project

At this moment we do not want to introduce the structure of the project, but to see whether the project can run smoothly

  1. Click on the solution in Startup.cs , then

    await context.Response.WriteAsync("Hello World!");
    

    changed to

    await context.Response.WriteAsync("Hello World!\nHello 简单教程 ( www.twle.cn ) ");
    
  2. Click the green triangle or the menu bar in the toolbar Debug -> begin (not debug) to start the project

    or

  3. This will bring up whether to trust the developer https certificate, select Yes

  4. Then it will use the default browser pop-up URL https: // localhost: 44381

    Display is as follows

    Web page run successfully, but the Hello World into a hello, world and simple tutorial words are garbled

    But the focus should not be addressed in this chapter

Successful operation of the site, indicating the success of our ASP.NET Core configuration environment

Welcome to add a personal Micro Signal: Like if thoughts.

I welcome the attention of the public numbers, not only recommend the latest blog for you, there are more surprises waiting for you and resources! Learn together and common progress!

Guess you like

Origin www.cnblogs.com/cool2feel/p/11422781.html