Detailed tutorial on vscode development. net core from installation to deployment, vscodecore

Source: Internet
Author: User
Tags server hosting

Detailed tutorial on vscode development. net core from installation to deployment, vscodecore

I. Environment preparation:

Windows systems require win7 sp1/windows 8/windows 2008 r2 sp1/windows10;

Installation of. NET Core SDK in other versions of windows may fail;

The. net core 1.1 version is shared here, And the 1.0 version is slightly different (the 1.0 project file is project. json, and 1.1 is changed to the. csproj file)

InstallVscode: Https://code.visualstudio.com /;

Install. NET Core SDK: Bytes;

 

2. Prepare to install the c # debugging plug-in. You can use debugging and other functions normally only when the plug-in is installed;

1: Click the extension icon of vscode, enter c # in the input box, and select the first one for installation;

2: it will be slow to download files from the Internet. We recommend that you use a proxy for operations or wait patiently. After installation, you will be prompted to re-load the vscode and confirm the re-loading;

3: If the installation fails due to network problems, you can use the OmniSharp installation package: Prepare;

4: the c # Plug-in is successfully installed.

Iii. Prepare to create a. net core project

1: Create a folder firstcoreweb, vscode file-> open the folder to open it;

2: Click vscode-> View-> integration terminal;

3: Enter dotnet new mvc and press enter to create a complete. net core web project;

 

4. Prepare for debugging

1: Execute the dotnet restore command on the terminal command line (a prompt is displayed on vscode indicating whether restore is required. Click restore) to update the nuget package, update the required nuget package to the local device;

2: place a breakpoint on the main method of program. cs (click on the left and a red dot indicates that the breakpoint has been hit );

3: Press F5 and the breakpoint has already entered;

Now the breakpoint debugging is successful;

If your project fails, check launch. json file. The program path must be set to the corresponding dll file path under the bin/debug directory where the current project is located. You can perform the above debugging steps with all your efforts.

 

5. Prepare to publish and deploy the. net core project to the iis server.

1: download and install Windows server hosting: https://www.microsoft.com/net/download/core#/runtime;

2: After the installation is complete, run the command dotnet publish-c release on the vscode terminal, and press enter to generate a deployment folder publish under the current project folder bin/release;

3: Add a website on the iis server. Specify the address to the generated deployable folder and run the site. The first site developed by. net core is running;

6: so far, the vscode development. netcore project has been completed from installation to development, debugging, and deployment. Have you guys gotten it? Help to you, please favorite share likes Oh original link: http://jingyan.baidu.com/article/86fae346f2e6273c49121ae0.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.