Whats New in ASP.NET Core Boilerplate

ASP.NET Core-Boilerplate

I have just updated the ASP.NET Core Boilerplate Visual Studio extension with a new project template targeting ASP.NET Core. This post is just a quick one to talk about what's new and different about this version of the template compared to the ASP.NET 4.6 MVC 5 version.

What's New

Well, the obvious thing is that this template targets ASP.NET Core which is currently still in beta. In particular I am targeting Beta 6 which is the current stable version. I will be regularly updating the template with each new beta until ASP.NET Core is released sometime in November according to Microsoft.

There are not too many new improved features over the ASP.NET 4.6 MVC 5 version but here is a quick description:

  1. Performance improvements derived from using ASP.NET Core. ASP.NET Core is much improved and no longer uses System.Web, so it uses a lot less memory.
  2. Using NPM and Bower to get CSS and JavaScript scripts rather than NuGet. This means you have a lot more choice and get the latest versions straight from the source.
  3. Switched from LESS to SASS for CSS. This decision was made because SASS seems to be more popular and the upcoming Bootstrap 4 has also made the same decision.
  4. Gulp is used instead of the standard ASP.NET 4.6 bundling and minification feature. Not only that but Gulp is also configured to optimize images, rebuild CSS and JavaScript on file change, lint the CSS and JavaScript for common errors and warnings and measure the speed of your site using Google Page Speed.
  5. The default ASP.NET Core project template uses Bootstrap-Touch-Carousel and Hammer.js for a nice touch friendly carousel control on the home screen.
  6. There is now a single controller action responsible for displaying errors. This is a lot simpler and a great improvement over MVC 5.
  7. The logging and caching services are now built into ASP.NET Core, so we use them instead.

What's Missing

ASP.NET Core is still in beta and there are a lot of third party libraries that don't yet support it. Support will be added as soon as it becomes available. I have contacted all three project owners and can confirm that support will be added soon.

The new .NET Core runtime does not currently support the System.ServiceModel.Syndication namespace which is used to build an Atom feed. The .NET Core runtime is still being targeted but the Atom feed will not work and is excluded using #if pre-processor directives. I have raised this issue on the .NET teams GitHub page here. Please do go ahead and show your support for the feature.

There are other issues around ASP.NET Core missing features from MVC 5 including no support for HttpException which I will be looking into adding soon. I am also looking into submitting any improvements I make to the ASP.NET Core GitHub project, so far, I've had one pull request accepted and a few suggestions acted on.

Conclusions

ASP.NET Core is still in beta but hopefully this project will give an understanding of what can be done with it. There are still missing features but it's surprisingly usable at the moment.

Web Mentions

What's this?

0 Replies

GitHub Comments

RehanSaeed

Mohammad Mohammad commented on 2015-09-02 05:38:37

Good Work Keep It Up

RehanSaeed

hgk3000 hgk3000 commented on 2015-10-09 11:17:25

My company start to build human resources (personal & payroll) web based application , would you recommend using asp.net 5 mvc 6 ?
what is best user interfaces and dashboard for mvc 6 ?

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2015-10-09 11:32:34

My company start to build human resources (personal & payroll) web based application , would you recommend using asp.net 5 mvc 6 ?
what is best user interfaces and dashboard for mvc 6 ?

If your application is going to be release in six months time then you should be ok but there are several things to consider:

  1. ASP.NET 5 is still a moving target. Things are still changing and being written. There are breaking changes with each new Beta release but these will become less common as time goes on.
  2. There are no third party libraries like Glimpse, Elmah, NWebSec, etc. Support for ASP.NET 5 is coming from all three but it's some way off.
  3. The documentation is still being written. It is not clear how to recreate everything you could do in ASP.NET 4.6.
  4. There is no VB support yet.
  5. It's a version 1.0 product, that means it may have rough edges and maybe a few bugs even when released.
  6. If you want to use the new DNX Core runtime there are even more limitations. You can't call a WCF service or us SyndicationFeed to create an Atom or RSS feed. There are lots of API's that do not exist yet.
  7. Each new Beta might break something e.g. Beta 5 broke browser link and view pre-compilation has been broken for a while. Things are getting more stable though with Beta 8.
  8. Some ASP.NET 4.6 features do not exist yet e.g. the BSON formatter.
  9. This is a new API, it may take time for it to be security hardened and proven.

That said, there is a lot going for ASP.NET 5. It's certainly a great improvement and there are many new improvements over ASP.NET 4.6.

As for the UI, most people use Bootstrap these days but I've benn looking into Zurb Foundation and Semanti UI which also have things going for them.

RehanSaeed

hafez hafez commented on 2016-01-08 20:55:10

Hi Muhammed
thanks for your nice template boilertemplate for ASP.NET 5 MVC 6, good work; i have a quick question are you planning to include localization or not ?
Kind Regards
Hafedh

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2016-01-26 08:41:09

Hi Muhammed
thanks for your nice template boilertemplate for ASP.NET 5 MVC 6, good work; i have a quick question are you planning to include localization or not ?
Kind Regards
Hafedh

Yes, in the ASP.NET 5 MVC 6 version. It will take time though.

RehanSaeed

Leo Torres Leo Torres commented on 2016-05-09 17:56:42

Hello, I didn't fill in website as I am trying to create one. I did C++ in college 16 years ago and I am a SQL Developer for 8 years now. I have hired web developers to do my application interface and they don't do it right and I waste time and money. I currently have pages I would like to re-write using the MVC 6 boilerplate technology but I am way to green in .NET to get it done. Can you provide me with some guidance as to where I can go to find resources to write my application. I have looked online and see MVC 6 and MVC 5 but nothing for boilerplate. I have also looked for books and cant seems to find any. Please help.

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2016-05-10 17:50:07

Hello, I didn't fill in website as I am trying to create one. I did C++ in college 16 years ago and I am a SQL Developer for 8 years now. I have hired web developers to do my application interface and they don't do it right and I waste time and money. I currently have pages I would like to re-write using the MVC 6 boilerplate technology but I am way to green in .NET to get it done. Can you provide me with some guidance as to where I can go to find resources to write my application. I have looked online and see MVC 6 and MVC 5 but nothing for boilerplate. I have also looked for books and cant seems to find any. Please help.

You can go to the asp.net docs website. They have really wonderful tutorials and documentation. It is a great place to learn.

RehanSaeed

Roger Roger commented on 2016-05-20 06:24:35

Great template, thanks for taking the time produce and release it to the rest of the world.

In my case I am running the website under a separate application directory to the main site. I found a few bugs with the template in this case. In the _Layout.cshtml template I found that the most of the link references are not placed within a Url.Content() call and so refer to an invalid location when the website is not the main web-site of the site. Anyway this is easy to fix.

I wanted to create some web apis but it seems there is something missing from your code template. My api is just performing a ToString() on the returned data object, it is like all the serialization formatters are missing or not initialised.
I think the boiler plate code is missing a NuGet package for this. Would you know what it is?

The biggest nightmare is trying to track things down with a search engine as there is a proliferation of versions of MVC!

thanks
Roger

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2016-05-20 08:52:06

Great template, thanks for taking the time produce and release it to the rest of the world.

In my case I am running the website under a separate application directory to the main site. I found a few bugs with the template in this case. In the _Layout.cshtml template I found that the most of the link references are not placed within a Url.Content() call and so refer to an invalid location when the website is not the main web-site of the site. Anyway this is easy to fix.

I wanted to create some web apis but it seems there is something missing from your code template. My api is just performing a ToString() on the returned data object, it is like all the serialization formatters are missing or not initialised.
I think the boiler plate code is missing a NuGet package for this. Would you know what it is?

The biggest nightmare is trying to track things down with a search engine as there is a proliferation of versions of MVC!

thanks
Roger

Is this MVC 5 or 6? Can you raise an issue on GitHub and we'll get that first issue fixed.

In MVC 6 you have to add the XML formatter yourself but JSON is there by default. Raise another issue with a bit more information and we'll get that sorted too.

RehanSaeed

Roger Roger commented on 2016-06-03 11:20:02

Is this MVC 5 or 6? Can you raise an issue on GitHub and we'll get that first issue fixed.

In MVC 6 you have to add the XML formatter yourself but JSON is there by default. Raise another issue with a bit more information and we'll get that sorted too.

Sorry it took me a while to reply

I am using version ASP.NET 4.6 MVC 5 of the boilerplate code.

Cannot find a link to the ASP.NET 4.6 MVC 5 version of the boilerplate code on this page.

regards
Roger

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2016-06-03 11:22:59

Sorry it took me a while to reply

I am using version ASP.NET 4.6 MVC 5 of the boilerplate code.

Cannot find a link to the ASP.NET 4.6 MVC 5 version of the boilerplate code on this page.

regards
Roger

ASP.NET Core Boilerplate GitHub

RehanSaeed

Roger Roger commented on 2016-06-29 14:15:15

ASP.NET Core Boilerplate GitHub

OK I fixed the Web API issue. I added the Microsoft.AspNet.Mvc NuGet passage to the project. Had to add a WebApiConfig class (to the App_Start directory):

public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        config.MapHttpAttributeRoutes();
        // config.
        config.Routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
            defaults: new { id = RouteParameter.Optional }
        );

        config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
    }
}

And then added

GlobalConfiguration.Configure(WebApiConfig.Register);

To the global.asax.cs file in the Application_Start.

regards
Roger

RehanSaeed

Vishal Donga Vishal Donga commented on 2018-06-12 05:53:50

Hello Sir, I want to make same demo as shown on official site of Asp.net boilerplate. Can you please tell me that how can I start it? I am not using Angular. I have no idea which kind of projects they have used(web application,mvc etc.). Can you guide me or reference me to do that?

RehanSaeed

Muhammad Rehan Saeed Muhammad Rehan Saeed commented on 2018-06-13 09:32:34

Hello Sir, I want to make same demo as shown on official site of Asp.net boilerplate. Can you please tell me that how can I start it? I am not using Angular. I have no idea which kind of projects they have used(web application,mvc etc.). Can you guide me or reference me to do that?

You need more help than I can provide. Go and read the ASP.NET Core docs and ask questions on StackOverflow.