使用yo aspnet来运行ASP.NET Core generator,以生成一个Web Application基础模板。
yo aspnet
yo aspnet生成的模板都是基于大家熟悉的Visual Studio 2015上的模板,这个模板维护在ASP.NET Templates project。
然后会提示What type of application do you want to create?
这里选择Web Application Basic [without Membership and Authorization]并回车。
接着会提示Which UI framework would you like to use?
这里选择Bootstrap (3.3.6) as the UI framework并回车。
用MyFirstApp作为应用名称并回车。如下图:
此时generator会生成项目的基础框架文件,然后提示你分别执行restore,build,run命令。
Your project is now created, you can use the following commands to get going cd "MyFirstApp"
dotnet restore
dotnet build (optional, build will also happen with it‘s run)
dotnet run
使用Visual Studio Code开发应用
用Visual Studio Code打开刚刚创建的项目,通过快捷键⌘⇧P输入dot,选择dotnet: Restore Packages来restore必要的build和debug项目依赖。可以在VS Code中直接运行包括dotnet restore在内的命令和所有在project.json文件中引用到的工具以及在.vscode/tasks.json中自定义的任务。