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
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:
- Empty Web Application
- Console Application
- Web Application
- Web Application Basic [without Membership and Authorization
- Web API Application
- Class Library
- 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.