Visual Studio Code First experience under Mac OS

Source: Internet
Author: User
Tags generator


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
    1. Mono 4.0.1
    2. Dnvm/dnx Https://github.com/aspnet/home
    3. Nodjs https://nodejs.org/
    4. Yeoman Http://yeoman.io
    5. HomeBrew http://brew.sh/
    6. 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


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.