(go) Step-by-step learning ASP. NET 5 (ii)-Create a project from the command line and sublime

Source: Internet
Author: User
Tags sublime text

Forward: Microsoft MVP Lu Jianhui article, hope to be helpful to everyone.

Note: Yesterday after the forwarding of many friends pointed out the name of the Vnext, the original author has made changes, the title of the following are applicable to the name of the ASP. NET 5.

Editor's note: Yesterday sent the first article, again thank you for the comments and feedback, here is explained that because now the ASP. NET 5 is still in beta, a lot of uncertainty, I will continue to revise, perhaps the official version will be changed, here I still want to spit slot Microsoft changed the name .... I respect it, forget it.


        Today tell us how to create your ASP. NET 5 project. Or you can get used to the template of visual Studio (for example), which is always available to you. But now I prefer to generate ASP. NET 5 project with sublime to do all the coding work with the command line script. (I do the fruit powder, so the article will be done on the Mac, hehe do not worry, the principle is the same on Windows/linux)

       

      & nbsp; Let's say you've read the first article (step-by-step learning of ASP. NET 5 (one)-basic concepts and environment configuration) The guidelines for configuring the ASP. NET 5 environment, then start creating the project. If you're on mac/linux/windows, you can install yeoman if you want to create an ASP. NET project from the command line.

        What is yeoman?  (click to enter the website)
       
       yeoman was developed by a team of Google and external contributors, with the goal of grunt (a command-line tool for developing task Automation) and Bower (an HTML, CSS, Package Manager for front-end resources such as JavaScript and images creates an easy-to-use workflow for developers. Yeoman has three main components: yo (scaffolding tool), Grunt (build tool), Bower (Package Manager). These three tools are independently developed separately, but need to be used together to achieve our efficient workflow patterns. In addition to resolving workflow patterns, the dependencies between packages and packages are addressed in the project. Look at you and see how these three modules work.

        

          Configure Yeoman on Mac, The premise is that you have to configure node. js as well as NPM. installation files you can go to the corresponding official website to download.

Install Yeoman from the following command line

NPM install-g yo//install yeoman via NPM

NPM install-g generator-aspnet//install Yeoman supported development templates, here is the template support for installing ASP. NET 5

Once you have completed these two steps, you can build the ASP. NET 5 project in the command line way.

Open command line on Mac Of course is comandline/windows is cmd, then enter Yo ASPNET, you will see the several projects shown


In addition to the traditional 5-piece set (Empty/console/web/webapi/classlibrary), there are also clothes elder brother favorite Nancy. Then you just need to move the cursor up and down to select what you need. To be honest, create a project from the command line, and the B-grid promotes fast.

I am here to create a Web application as an example, the cursor selects the Web application press ENTER, it will ask you the project name, you can enter the good to create the project (e.g.)

You can then compile and run your Web application project by entering 3 commands.

1. KPM restore restores the packages and dependencies required for your project

2. KPM Build Recompile

3. K kestrel/k Web runs your Web project locally, note here that Kestrel is for the Mac/linux platform, the web on the Windows platform.

These three orders are just a review of yesterday's four K. Oh forget to call DN it.

The command line is the command line, and when you need to edit the project, especially the non-Windows platform, you still need an IDE, I still recommend sublime. You can also use Vim, which is a personal preference.


Sublime Text Development ASP 5 Environment configuration

Of course, you need a sublime. This is not expensive to buy, one-time purchase of multiple platforms, for the need for work will not be poor so little money. Sublime text has the advantage of more plug-ins, if you need to install the package Control must be installed first Plugin, because this is necessary. equals one plug-in support. Refer to this (click to open the link).

Once the installation is successful, you can install the support for ASP. NET 5 through the package Control, which is really thanks to open source. This bag is called kulture. Installation steps also do not elaborate, follow this link in step to step to be (click Open link), after restarting sublime, pull the project folder into sublime you can cmd+shit+p/windows on the Mac Ctrl + Shit+p, then choose Run K Command to call Kulture to compile and run your ASP. NET 5 project.

You will miss Visual Studio Smart tips, of course sublime will also have a corresponding plugin-omnisharp (click to open the link). Well, with Sublime+kulture + Omnisharp, you can easily complete your work under sublime with a well-equipped, clear-level ASP. NET 5 operating environment.

Here today, thank you! Tomorrow will talk about the basic structure of ASP. NET 5, of course, I hope you give me timely feedback. Thank you!

Original address: http://blog.csdn.net/kinfey/article/details/44340545

(go) Step-by-step learning ASP. NET 5 (ii)-Create a project from the command line and sublime

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.