Yeoman generators Creating an ASP. NET Application
Previous: "Windows build. NET Cross-platform environment and run applications"
Read the catalogue:
- Install node. js
- Install yeoman-generators
- Create ASP. NET WEB Application
- Run ASP. Web Application
The console application in the previous article, the code is we handwritten, on two files: HelloWorld.cs and Project.json, very simple, do not use Visual Studio 2015 and other editors, how do we create and run an ASP. The answer is to use Yeoman generators, and we'll do it step-by-step.
1. Install node. js
Download the latest version from the node. JS website and follow it:
It should be noted that the version of node. js must be 0.10.0 or more, or it will hold the following error:
2. Install yeoman-generators
Install the command correctly (for Windows):
install -g yo generator-aspnet
Error Install command (for other systems):
install -g generator-aspnet
The correct installation is successful:
Error installation succeeded:
3. Create ASP. NET WEB Application
To create a command:
PS > yo aspnet
Select item:
Complete the operation:
ASPNET. Sample File Structure:
4. Run ASP. Web Application
The ASPNET is created. After Sample, there are four commands:
If the following error occurs in the execution dnu, you can set the following environment variable: %userprofile%\.dnx\runtimes\<runtime name>\bin
or execute the next dnvm upgrade
command.
The first step:
restore
Step Two:
PS > dnu build
Step Three:
PS > dnx . web
Fourth step: Browser input localhost:5000
. NET cross-platform, where the Windows environment is built, and then try the Mac OS X system again.
Yeoman generators Creating an ASP. NET Application