Click here to Skip to main content
14,635,020 members
Articles » Web Development » ASP.NET » General
Technical Blog
Posted 5 Jan 2016

Tagged as

Stats

11.9K views
12 bookmarked

Quick Summary of What’s Changed in ASP.NET 5

Rate this:
4.55 (13 votes)
Please Sign up or sign in to vote.
4.55 (13 votes)
5 Jan 2016CPOL
This post lists what's changed in ASP.NET 5

It’s been a quite a while since ASP.NET 5 is released. And ASP.NET 5 is completely different from its previous version. In fact, it is completely re-written to make it fast, better, modular, cross platform support. So here is a quick and short summary of what’s changed in ASP.NET 5 compared to all its previous versions.

Here is What’s Changed in ASP.NET 5

[UPDATE: ASP.NET 5 is now ASP.NET Core 1.0] and also read What's new in ASP.NET 5 RC 2?

  • The first and most important change is that “ASP.NET 5 is open source and cross platform.”
  • ASP.NET 5 works with two runtime environment (.NET Core and .NET Framework). .NET core is for all platforms (windows, linux and OSx) where .NET framework is for windows.
  • ASP.NET 5 project is now much cleaner. When you create a new project, it includes only required dependencies.
  • ASP.NET 5 applications are built and run using the new .NET Execution Environment (DNX). Every ASP.NET 5 project is a DNX project. There are two main flavors, DNX 4.6.X (the full framework) and DNX Core 5.0 (the light-weight open source .NET version that also runs on Linux and Mac). DNX Core contains almost everything but is missing a few Windows namespaces like System.Drawing for example.
  • We can use both the frameworks “dotnet 4.6” and “dotnet core” in our application. They are defined in framework section of project.json file. The advantage is that common compatible code can be shared, which works for both the frameworks. But there are some libraries which will not work with .NET core like reflection or drawing bit map. But we can separate code using #if directives. Like:
    #if DNX451
       //code targeted for .NET 4.5.1
    #endif
    #if DNXCORE50
       //Code targeted for core clr
    #endif
  • There is also a command line tool named “DNVM – .NET version manager“. It allows to upgrade or install new dnx version.
  • ASP.NET 5 works on file system which allows faster development cycle. It detects the code changes (even outside Visual Studio), compiles into memory and loads the application.
  • ASP.NET 5 has inbuilt support for Dependency injection. ASP.NET 5 includes a simple built-in container (represented by the IServiceProvider interface) that supports constructor injection by default, and ASP.NET makes certain services available through DI.
  • ASP.NET 5 is also cloud ready as it supports environment-based configuration. Read more about environment-based configuration in launchSetting.json file.
  • ASP.NET 5 uses completly new light-weight and modular HTTP request pipeline.
  • HTTPHandler and HTTPModules are also gone. Now they are replaced with Middleware.
  • The heart of ASP.NET application “System.web” DLL is no longer available.
  • With ASP.NET 5, webforms are history. Though, you can use webforms using .NET 4.6 framework.
  • JSON is preferred over XML for configuration settings. Read Various JSON files in ASP.NET 5.
  • There are no web.config and global.asax files now. web.config is replaced with appsettings.json and global.asax is now Startup.cs. Startup.cs is entry point for the application itself. Also read “Static Void Main in ASP.NET 5 startup.cs“.
  • The new Project.json file is the heart of your project. It defines dependencies, runtime to use, and defines build and publish setup. It defines as project as DNX project.
  • wwwroot directory in project is for static content like css, Js, images. And it’s the default root of your server. If a request comes in for a static file on disk, if the file is in this folder, then it can go back to client. The name can be changed from project.json file. Read this post to find out how to change it.
  • All our compiled DLLs are placed into project’s Bin folder. And now the bin folder is moved to “Artifact” folder (at the same location).

    Artifact folder

  • Now, you can directly add the reference of any assembly just via typing. Add assembly name with version in project.json file and Visual Studio will add the reference for you. Read my post “What is Project.json in ASP.NET 5
  • ASP.NET 5 is designed to integrate seamlessly with a variety of client-side frameworks, including AngularJS, KnockoutJS and Bootstrap.
  • ASP.NET 5 has also inbuilt support for client side package manager bower. It now also supports JavaScript task runners grunt/gulp, web project scaffolding tool Yeoman. Read “Why Yeoman for ASP.NET applications?” They have also integrated inbuilt support of TypeScript. Read Latest TypeScript Interview Questions for beginners
  • Bundling and minification is done using grunt or gulp, unlike defining bundles in BundleConfig file.
  • ASP.NET 5 also comes with Unified Programming Model for MVC6 and Web API. In previous versions of ASP.NET MVC, MVC controllers were different from Web API controllers. An MVC controller used the System.Web.MVC.Controller base class and a Web API controller used the System.Web.Http.ApiController base class.
  • .csproj becomes .xproj. The new project file doesn’t include manifest and list of all the files that are included in your project, as earlier with .csproj.
  • By default, a class library project when compiled, becomes a nuget package instead of DLL.
  • There is also a new code editor named “Visual Studio code” to work on linux and mac. Read What is Visual Studio Code and is it different from Visual Studio 2015?

That’s all I can think of. I know there are many points which can be included in this list. But I want to keep this short and simple. If you come across any, please mention in the comments section or send it on twitter/facebook. Keep visiting for updates and share this in your network.

The post Quick summary of what’s changed in ASP.NET 5 appeared first on Talking Dotnet.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Talking Dotnet
Technical Lead
India India
I am an experienced Software Developer with 11+ years of hands-on experience working with Microsoft.NET technology (ASP.NET, ASP.NET Core, C#, SQL Server, Angular).

Visit Talking Dotnet
For ASP.NET Core, read ASP.NET Core Articles

Comments and Discussions

 
QuestionNo Bin Folder Pin
IrishChieftain6-Jan-16 11:18
MemberIrishChieftain6-Jan-16 11:18 
AnswerRe: No Bin Folder Pin
Talking Dotnet6-Jan-16 19:14
MemberTalking Dotnet6-Jan-16 19:14 
GeneralRe: No Bin Folder Pin
IrishChieftain7-Jan-16 5:09
MemberIrishChieftain7-Jan-16 5:09 
Question.NET Core for Windows too Pin
Tim Friesen6-Jan-16 2:45
MemberTim Friesen6-Jan-16 2:45 
AnswerRe: .NET Core for Windows too Pin
Talking Dotnet6-Jan-16 4:31
MemberTalking Dotnet6-Jan-16 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.