Click here to Skip to main content
15,891,033 members
Articles / Web Development / ASP.NET / ASP.NETvNext

Why Yeoman for ASP.NET 5 Applications?

Rate me:
Please Sign up or sign in to vote.
4.76/5 (5 votes)
27 Dec 2015CPOL4 min read 10.5K   8  
While learning .NET 5, I read that Yeoman now supports ASP.NET 5 application and it’s actually surprised me. And the first very thought that came to my mind was “WHY?” Why Yeoman for ASP.NET 5 applications?

While learning .NET 5, I read that Yeoman now supports ASP.NET 5 application and it’s actually surprised me. And the first very thought came to my mind was “WHY?”

Why Yeoman for ASP.NET 5 Applications?

Before we get to our topic, let’s understand about yeoman.

What is Yeoman?

Yeoman is, as per their official tagline Yeoman is “The web’s scaffolding tool for modern webapps”. And they are spot on with this. So let me put in simple language what Yeoman can do for you. Yeoman can provide you a project structure, prescribing best practices, manage your dependencies and tools to help you stay productive. For example, if you are new to web application development and you have no idea about structure of your web app, best practices and required tools and dependencies. Well in such scenario, Yeoman is a great help.

Yeoman recommends a workflow to improve your productivity and reduce your development time. The workflow is composed of three tools: yo (a scaffolding tool), Grunt/Gulp (A JavaScript task runner and a build tool) and Bower a package manager (alternatives are available).

To start with, first install all Yeoman workflow tools using npm.

npm install -g yo bower grunt-cli gulp

Read the following articles for better understanding about grunt and gulp.

Now, you also need to install a generator. Generator is going to help you get your project structure and all dependencies. And for every language/framework/application, there is a separate generator. Like for angular js application, there is angular generator and for jQuery application, there is jQuery generator. For this post, we will be installing <a href="https://github.com/yeoman/generator-webapp" target="_blank">webapp generator</a>, which is the default web application generator that will scaffold out a project containing HTML5 Boilerplate, jQuery, and Grunt. You can get a list of all Yeoman generators here.

npm install -g generator-webapp

Now, let’s create our webapp.

mkdir YoFirstWebApp // To create a new directory.
yo webapp 

And you should see the following screen. And read the message “Out of the box, I include HTML5 Boilerplate, jQuery and a gruntfile to build your app”.

Creating webapp using Yeoman

And it is also prompting you to include SASS, Bootstrap and Modernizr. Select using space and hit enter. You should see the following screen where it is loading dependencies.

Creating webapp using Yeoman Loading dependencies

Once everything has been completed, your web application is ready. That’s really wonderful stuff. Isn’t it? Here are some articles on “How to use and start with Yeoman” which you can go through to learn more about Yeoman.

Let’s get back to our topic “Why Yeoman for ASP.NET 5 applications?

Yeoman also has generator-aspnet to scaffold your ASP.NET projects. I will not be going into detail about how to install and use it for ASP.NET application. You should read “Building Projects with Yeoman”. Please read the article before going down.

I assume that you have read the post. Now the question is that whatever ASP.NET web application structure is created using yo, can also be created using: Visual Studio 2015 -> New Project -> ASP.NET web application.

We all know how powerful editor Visual Studio is. In fact, it’s not an editor, it’s an IDE (Integrated development environment). When I can get the same thing done via Visual Studio 2015, then why use “Yeoman for ASP.NET applications?” To address this, one can give the following argument.

  • It’s useful for front-end developers/UI developers who are not familiar with ASP.NET. But then again, Visual Studio can do the same job for you.

That’s fine. But there still has to be a concrete reason for this. Well, the reason is that we all are aware that .NET 5 is cross platform which means it works on Windows, Linux and macintosh machines. And the bad news is that “Visual Studio 2015 works only on Windows machines.” So for building ASP.NET applications on other than Windows platform, developers use Visual Studio Code. And VS code is just an editor and it’s not as powerful as Visual Studio 2015. You should read “What is Visual Studio Code and how it is different from Visual Studio 2015.

VS Code is file and folder based as compared to Visual Studio, which is project or solution based. You don’t open a solution in VS Code, you simply open a folder and if a supported project exists, we will load it. You don’t get options like create new website or application with VS Code. And that’s why Yeoman comes into the picture.

To summarize this, Yeoman with ASP.NET provides ASP.NET web application project scaffolding. And it may not be useful on Windows as Visual Studio 2015 can perform the same job. But other than Windows platform, Yeoman is the only option to build ASP.NET application. Yeoman is pretty handy on Linux and Mac or even on Windows if you don’t want to use Visual Studio. And that’s answer “Why Yeoman for ASP.NET 5 applications?

If you know any other reason than this, please write your feedback in comments section. I will update the article accordingly. Meanwhile, share this in your network.

The post Why Yeoman for ASP.NET 5 applications? appeared first on Talking Dotnet.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
I am an experienced Software Developer with 11+ years of hands-on experience working with Microsoft.NET technology (ASP.NET, ASP.NET Core, C#, SQL Server, Angular).

Visit Talking Dotnet
For ASP.NET Core, read ASP.NET Core Articles

Comments and Discussions

 
-- There are no messages in this forum --