One of the tutorials for developing. Net Core 2.0 MVC Web applications using VS Code, coremvc

Source: Internet
Author: User

One of the tutorials for developing. Net Core 2.0 MVC Web applications using VS Code, coremvc

Now, let's assume that you have installed the VS Code development tool ,. net Core 2.0 preview version of the SDK dotnet-sdk-2.0.0 (pay attention to your own operating system), and has been installed for VS Code C # extension (in the VS Code extension menu input OmniSharp, install extension)

1. Create a folder in a magic directory on the hard drive of our computer. Select the folder named MyCMS under D: \ WorkTest. Note: This step is not completed in VS Code. It seems that the folder cannot be created in VS Code.

2. In the VS Code development environment, select File> Open folder and select the magic folder MyCMS we just created to open

3. Choose View> integrated terminal command or press the shortcut key Ctrl + '. A powerful tool will appear in the VS Code development environment. Why is it so powerful? Because we enter some magical commands here, some magical phenomena will happen in our project. For example, enter the command in the integration terminal.Dotnet new sln-n MyCMS, A solution MyCMS. sln will appear in our MyCMS folder. For example:

4. Next, enterDotnet new mvc-n MyCMS. WebAfter a while of struggling and tossing VS Code, we will find an MVC project named MyCMS. Web in the file list on the left. For example:

Launch. jsonSuch:

Dotnet build MyCMS. WebRun the command and press Enter. After the task is finished, it becomes a thing under Debug. All right, let's put the generated content in the program of the. NET Core launch (web) configuration item in Launch. json, and change the cwd at the bottom of the pipeline by the way. After the event, it looks like the following:

. NET Core Launch (web), again press F5, or not, and it tells us what else to get:

$ {WorkspaceRoot} indicates the root directory of your project. Do not write it as an absolute path. Otherwise, you cannot find anything after your project is released.

"Options": {"cwd": "$ {workspaceRoot}/MyCMS. after the Web "} is configured, the effect is as follows: 11. This time, let's press the F5 key ------------- the magic thing happened. It's already taking shape. the Net Core MVC website is in front of us. Do you think you are amazing? Haha, well, just kidding. This website also looks at the effect. When we look back at our actual development project, the content here will basically be deleted, and there will be an empty shell. For example: 12. Postscript: I don't know what it means to have a lot of things in it. I ran the project after a long time, it is much more troublesome than developing in visual studio 2017. But that's it. You and I will understand it later. Not afraid!

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.