Visual studio code initial experience in Mac OS and studio initial experience
Visual studio code initial experience in Mac OS
With the step-by-step development of Microsoft's open-source policy, Microsoft finally waited for the cross-platform Visual Studio Code. As A. NET plug-in using macbooks, it is a blessing. (I tried to use Xamarin/Eclipse/IDEA to edit the. net source code on a Mac, which is not very nice to use .)
The process of building a development environment on the mac system is simple.
Install and install HomeBrew in dependent Environment
To install Open-Source Software in MacOS, Hombrew is essential. Therefore, first install HomeBrew, open Terminal, and execute
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Nodejs
Run
npm install -g yo grunt-cli generator-aspnet bower
Install yeoman
Execute in shell:
npm install -g yo grunt-cli generator-aspnet bower
Install dnx
Run
brew tap aspnet/dnxbrew updatebrew install dnvm
This step has a pitfall. If brew update fails, it must be resolved. Otherwise, the wrong dnx version may be installed.
During this installation process, HomeBrew will try to install Mono.
You cannot use it immediately after installation. You need to configure the shell environment variable ~ /. Add the following to bash_profile:
export MONO_MANAGED_WATCHER=falsesource dnvm.shexport PATH=$PATH:~/.dnx/runtimes/dnx-mono.1.0.0-beta4/bin
Note:export MONO_MANAGED_WATCHER=false
If not configured, the ASPNET will have a kqueue error.
In addition, it is possible that no download is available for dnx after the dnvm is installed (I have encountered it ). Thereforesource dnvm.sh
You can rundnvm upgrade
. After execution, check ~ /. Whether the dnx directory contains only empty directories. If yes, remove dnx-mono and re-Execute dnvm upgrade.
Start the first project
yo aspnet
Select Web Application and enter the project template. The following message is displayed:
At this time, you have two options
1. Restore the nuget package in the terminal
dnu restore
Or open vscode directly.
Visual studio provides command line integration similar to sublime. Use Command + P to call out the Command line tool and enter:
>dnu restore
In this case, the nuget package is automatically restored.
At this time, your first web app can be run. Just give it a try. Similarly, use Command + P to call out the Command line interface and enter
>dnx . kestrel
At this time, your web app can be seen on port 5001.
Summary
The entire process is still relatively smooth. visual studio code is currently only a "code" tool and cannot be expected to be as useful as some full-stack development tools. However, this step at least shows that Microsoft has taken the lead in open source.