Visual Studio Code First experience under Mac OS
As Microsoft's open source strategy moves forward, it finally waits for a cross-platform visual Studio Code. As a. NET program that uses the MacBook, the ape has to be said to be a boon. (Trying to use Xamarin/eclipse/idea to edit. NET source code under MAC is not particularly cool.) )
The process of building a development environment on a MAC system is a simple arrangement.
Environment of Dependence
- Mono 4.0.1
- Dnvm/dnx Https://github.com/aspnet/home
- Nodjs https://nodejs.org/
- Yeoman Http://yeoman.io
- HomeBrew http://brew.sh/
- Visual Studio Code http://code.visualstudio.com
Environment-dependent installation and installation homebrew
Installing open source software under MacOS is essential, so hombrew first installs homebrew, opens terminal, executes
-e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Nodejs
Perform
-g yo grunt-cli generator-aspnet bower
Installing Yeoman
Execution in Shell:
-g yo grunt-cli generator-aspnet bower
Installing DNX
Perform
brew tap aspnet/dnx
brew update brew install dnvm
There is a hole in this step, if the brew update fails, it must be resolved, or the wrong version of the DNX may be installed.
During this installation, homebrew will attempt to install mono.
After installation is not immediately available, you need to configure the shell environment variables to add in ~/.bash_profile:
export MONO_MANAGED_WATCHER=false
source dnvm.sh
export PATH=$PATH:~/.dnx/runtimes/dnx-mono.1.0.0-beta4/bin
Note thatexport MONO_MANAGED_WATCHER=falseif you do not configure the ASPNET, the Kqueue error will occur
In addition, there may be dnvm after installation, Dnx no download possible (anyway I met). Therefore, after executionsource dnvm.sh, it can be executeddnvm upgrade. After execution, check if there is only an empty directory under the ~/.dnx directory, and if so, re-execute DNVM after removing Dnx-mono upgrade
Start the first project
yo aspnet
Select Web Application, enter and complete the project template, you will be prompted:
At this time, you have two choices
1. Recovering NuGet packages in the terminal
dnu restore
or open Vscode directly.
command-line consolidation like sublime is available in Visual Studio. Using the COMMAND+P call-out command line tool, enter:
>dnu restore
At this point, NuGet package recovery is performed automatically.
At this point, your first web app is ready to run, just try it, and use the Command+p Outbound command line interface to enter
>dnx . kestrel
Your web app is now visible on port 5001.
Summarize
The process is still smooth, and Visual Studio code is now just a "code" tool, and cannot expect it to work as well as some full stack development tools. But this step, at least, lets us see that Microsoft has stepped up its open source.
Visual Studio Code First experience under Mac OS