. NET Core VS Code Environment configuration

Source: Internet
Author: User
Tags dotnet install node

. NET Core VS Code Environment configuration

Vscode. NET Environment configuration

Before that I used to write code using the c/c# environment of the notepad++ configuration, which was much more convenient than opening the "cumbersome" vs. Vscode came out, would have wanted to toss a bit, but at that time too little data, configuration did not succeed, also feel notepad++ That's enough. Until a few days ago in the blog Park to see the park Friends Linezero shared << use vs code development debugging. NET Core Application >&gt, and I have the idea of changing the editor. The result was a day before the environment was configured. This is divided into three parts
    • . NET Core
    • Vs Code
    • . NET Core VS Code
. NET CoreAbout. NET core I was just beginning to learn, so there is no way to introduce a lot. But it is relatively simple to build. You can go to the official website to see: https://dotnet.github.io/. I use Win10 x64 system, other platforms can go https://   Github.com/dotnet/cli. Get the appropriate version. After installation, test whether the installation is successful, and enter it under CMD:
mkdir HWAPPCD hwappdotnet New
Dotnet New will create a Hello World program. and then type
dotnet Restoredotnet Run
If Hello World appears. Congratulations on your first step. * If you report this error when you perform a restore.
12 Unable to resolve ‘Microsoft.NETCore.App (>= 1.0.0-rc2-3002376)‘for‘.NETCoreApp,Version=v1.0‘.
The workaround is to create a new Nuget.config file in the project and restore it again.
12345678 <?xml version="1.0"encoding="utf-8"?><configuration><packageSources><clear /><add key="dotnet-core"value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"/><add key="api.nuget.org"value="https://api.nuget.org/v3/index.json"/></packageSources></configuration>
Reference: HTTPS://GITHUB.COM/DOTNET/DOTNET-DOCKER-PREVIEW/ISSUES/8 https://github.com/dotnet/cli/issues/2419 https:// github.com/dotnet/cli/issues/2484 https://github.com/dotnet/cli/issues/2384 VS CodeBecause of the VS code I am also a beginner, but after a day of understanding from the intuitive feel a few aspects better than notepad++.
    1. Support Debugging.
      I didn't find a good way to do this on the notepad++. Maybe I'm not particularly familiar with notepad++.
    2. File & Project Management.
      Because the use of notepad++ is to write some small programs. The basic project is also used VS, so it is not very well understood notepad++ support for this piece.
    3. Reference assembly.
      Because the notepad++ configuration of the C # environment uses a batch process. Not very convenient when referencing assemblies.
    4. Git support
      I don't know if this is an advantage.
    5. Feelings
      I have a bit of a Microsoft episode. After all, the home platform of things, not support is too unreasonable.
1. Download and install VscodeHttps://code.visualstudio.com 2. Download and install gitHttps://git-scm.com/download/win 3. Download and install node. JShttps://nodejs.org/en/(node. JS installation package contains NPM management tools, similar to NuGet) so far, you can use node. js for development, here Vscode an example: https:// Code.visualstudio.com/docs/runtimes/nodejs Express first installs Express, described as a scaffold to build the node. JS program. Easy to use, type in cmd
NPM install-g Express-generator
Once the installation is complete, you can create an app.
Express Myexpressapp
Go to the Myexpressapp folder and install the app
CD MYEXPRESSAPPNPM Install
Then launch the app
NPM start
Access via browser: http://localhost:3000 can see the page, execute CTRL + C in CMD to terminate the program. (up to this point, we did not use Vscode) after installing vs code can be passed "code." To start the current project, we are in the Myexpressapp directory:
Code.
Then the F5 can be debugged. . NET Core VS CodeOK, the appetizer is over. How to Debug. NET core with VS code. Here you can refer to the article of Linezero << use vs code to develop and debug the. NET core application from scratch >&gt. 1. Install the omnisharp extension.You can go to git and download Omnisharp:https://github.com/omnisharp/omnisharp-vscode * Here I did run into "Omnisharp server is not running" error. 2. Open the. NET Core ProjectYou can open a project by using code in a previously created demo. If the installed plug-in does not have a problem, the first boot will have a prompt to add the run and Debug configuration files. Here you need to change the Lunch.json to specify the program as the currently generated file. If you have to specify every time, it seems to be a bit troublesome, do not know if it is not my configuration is wrong. Additionally, a DEBUGTYPE is configured in the Project.json. 3. Debug RunSome references: Https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md https:// GITHUB.COM/OMNISHARP/OMNISHARP-VSCODE/ISSUES/82 ASP. NET Core Reference: https://azure.microsoft.com/en-us/documentation/ Articles/web-sites-create-web-app-using-vscode/https://code.visualstudio.com/docs/runtimes/aspnet5

. NET Core VS Code Environment configuration

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.