Create Visual Studio Core Application With Yeoman

Introduction
 
In this article, we will explore how to install and create a new Visual Studio application using Yeoman.
 
About Yeoman
 
“Yeoman helps you kickstart new projects, prescribing best practices and tools to help you stay productive.” Visit http://yeoman.io/
 
Yeoman is an open source tool that helps to generate complete projects, like Visual Studio project templates with various platforms including Windows, Linux and Mac etc.
 
Installing Yeoman
 
Open the command prompt with admin privilege and run the below command:
 
“npm install -g yo bower grunt-cli gulp”
 
If you want to install the latest version of Node.js, use the below command:
 
“npm install npm@latest”
 
To know the version of the Node.js, use
 
“npm –v”
 
 
The last step is to run the following command:
 
npm install -g generator-aspnet
 
Please visit http://yeoman.io/generators/ for learning more about Yeoman generators and different types of Yeoman generators.
 
So, our installation is completed and if you face any issues, you can use the command “yo doctor” to identify issues with your installation.
 
See the example in the below image.
 
 
Creating an application with Yeoman
 
Run the “yo aspnet” command in the command prompt. It will ask which type of application you want to create. There are different types of project templates available, like the following:
  1. Empty Web Application
  2. Console Application
  3. Web Application
  4. Web Application Basic [without Membership and Authorization
  5. Web API Application
  6. Class Library
  7. Unit test project
Use the arrow key to select one of the application types. Here, I am going to select “Empty Web Application”.
 
 
 
First, we need to provide our application a name.
 
 
 
Yes. Now, our new application is created.
 
 
 
Please have a look on the folder. Here, we can see all project related files and folders.
 
 
The next step is to run the application. For this, we can use the CLI commands.
  • dotnet restore
  • dotnet build
  • dotnet run
Using the above mentioned commands, we can build and run our application.
 
 
 
Compilation is completed and we are going to run the application, using “dotnet run ” command.
 
 
 
Go to the browser and type http://localhost:5000
 
 
 
Conclusion
 
In this article, we learned how to install, create, and run the VS application, using Yeoman.


Similar Articles