There are some new ASP.NET Core project templates released to play with. Using these templates you can create a MVC starter application, a static website application template and Vue.js with WebPack. At this point of time, it’s not clear whether they are going to be part of official ASP.NET Core templates. To use them, you need to download a VSIX extension
New ASP.NET Core Project Templates
To use these new templates, .NET Core Tooling Preview 2 installed. You can download the VSIX extension from VS Gallery.
Just run the download VSIX extension to install these new templates. Once installation is finished, open Visual Studio 2015, Hit File -> New Project. And you should see something similar.
As you can see, there are 3 new templates added.
- ASP.NET Core MVC Starter Application
- Static Website
- Vue.js with WebPack
ASP.NET Core MVC Starter Application
This template is different from the current web application template. With this template, there are no client-side libraries or tooling included. Which means, no Bower, npm, Gulp or Bundler. It’s clean and there are no hidden files and folders.
The purpose of this template would be to learn about ASP.NET MVC. But I don’t see a specific purpose of this template, as learning about ASP.NET MVC can also be done using default ASP.NET Core web application template. One thing I did notice is that, there is a Model folder present with this new template. Where by default, the default web application template doesn’t have a “Model” folder. 😉 Following is the output in the browser.
This template is for building static websites using the ASP.NET Core project. It has wwwroot folder, project.json and startup.cs only. So, all your static content will be going into wwwroot folder.
If you don’t want to use the wwwroot folder for your static content, then you can rename it or remove it. Once you remove it then you can either place your static content in a different folder or in the project root. But then you need to tell ASP.NET Core, from where to pick up static content. Open Startup.cs and you should see
static void Main(string args) method. And change following line,
.UseWebRoot(".") // use "." to completely remove the wwwroot
Following is the output in the browser,
There is no difference between output of both the templates in the browser. However, in case of Static website, things are hard-coded in the html where in MVC template, things are coming via MVC route.
At this point of time, there is nothing exceptional about these template. But these are early days so things might change and becomes better in future.
Thank you for reading. Keep visiting this blog and share this in your network. Please put your thoughts and feedback in comments section.
If you want to learn ASP.NET Core, I want to personally recommend Programming ASP.NET Core as the best resource out there.