If vNext or .Net 5 sounds new to you (which of course I believe it is not) or you want to read about the basics of these then please go through the following articles that I posted earlier:

Install Visual Studio 2015 Ultimate Preview

I recommend that you install VS2015 to explore all these utilities and the awesome features provided with ASP.Net 5. To read more about the installation of VS2015, please go through my article: Setup Visual Studio 2015 Preview Quickly Via Azure.

(This was also chosen by ASP.Net as the article of the day.)

ASP.Net 5 Redesign

ASP.Net 5 has undergone a major redesign from existing frameworks. Now we have three choices for choosing the framework:

framework

Let's look at these runtime environments.

Click OK and the project structure is ready. The project structure contains MVC folders and configuration files. Let's have a look at these configuration files.

configuration files

wwwroot folder

This promotes a separation of code, since your code behind files are separate from the static client files. This new wwwroot folder contains assets that the app will serve directly to clients, including HTML, CSS, image and JavaScript.

Choice of framework

Now that we have an idea of the folder structure and files, it's time to see the effect of these new configuration files:

You can select / switch among frameworks after selecting Project > Properties…

Properties

Other tools/utilities:

These new configuration files use other platform/tools also, let's understand them.

Node jsNode.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Definition by: NodeJS.

You can install Node.Js from the site or I prefer using: Chocolatey.

twit Bower, manages all these things for you. The web sites are made of many things, frameworks, libraries, assets, utilities and rainbows.

Install bower
npm install -g bower

npm installGrunt is the JS taskrunner. The need to use Grunt is to do automation, it helps in automating many tasks, like minification, compilation, unit testing, linting, and so on, the easier your job becomes. If you visit the site you'll find many plugins available: Gruntjs.

Run the following command to install Grunt.

Great!! You've installed the various tools now. Let's revisit the project we've created and understand the structure.

Demo of bower

If you want to install any dependency that you want to use in your project, for example AngularJS, then go to bower.json and add AngularJS. For example:

AngularJS

The full code will look like:

Full code

Now, we've given the reference, you can view this by expanding Solution Explorer Dependencies > Bower.

Bower

It says that AngularJS is not installed. There are two ways to install AngularJS in the project:
  1. Right-click and fire the command Restore Package.

    command Restore

  2. Go to the command prompt and run the bower update.

    command prompt

    The output of both commands will add AngularJS to your project.

Demo of Grunt

As we know Grunt is a taskrunner and this demo will show you the task grunt-contrib-copy.

We're all set to use this plugin. You can leverage VS2015.

  1. Right-click on gruntfile.js and run Task Runner Explorer.

    task runner

    You'll notice there are two tasks now:

    copy

    Bower the default one provided by scaffold and copy that that we created in gruntfile.js. Double-click on the copy task to run it and it'll copy the Library>Custom.js file to the destination folder wwwrrroot.

    Custom js

  2. You can do the same operation via command prompt by firing grunt copy.

    result command prompt

    Validate the tree structure or look into Windows Explorer and you'll find the following pattern:

    tree structure

Summary

ASP.Net 5.0 is really powerful and has capabilities of other tools and frameworks too. We've unleashed the power of NPM, bower and grunt. There are many Grunt plugins available that make your life easy, for examle the common tasks linting, minification and obfuscation can be handled easily via Grunt plugins.