ASP.NET 5.0
ASP.Net 5 is a lean .NET stack for building modern web applications. It was built from the ground up to provide an optimized development framework for applications that are either deployed to the cloud or run on-premises. ASP.Net 5 consists of compact components with negligible overhead so developers can feel flexibility while constructing their applications.
ASP.NET 5 includes the following features:
- New flexible and cross-platform runtime
- New modular HTTP request pipeline
- Cloud-ready environment configuration
- Unified programming model that combines MVC, Web API, and Web Pages
- Ability to see changes without re-building the project
- Side-by-side versioning of the .NET Framework
- Ability to self-host or host on IIS
- New tools in Visual Studio 2015
- Open source in GitHub
The changes made for ASP.NET 5 were based on customer requests and feedback. These changes simplify development, hosting, and maintenance, and are targeted to modern web applications.
Legacy applications will run on the new version of the ASP.NET without any modifications. However, to take advantage of the new features in ASP.NET 5, existing code will need to be ported to the new framework. There are many similarities between ASP.NET 5 and earlier versions of ASP.NET, so porting code involves fixing particular issues rather than re-writing the app.
The need for a flexible, cross-platform runtime
In the past, the .NET Framework was delivered as a single, all-encompassing installation. With each release of .NET, features were added but rarely removed, so the size of the framework continually grew. This approach ensured that a Windows machine with .NET installed could support every type of .NET app, but it also meant that each app depended on features which were not actually being used.
If a critical update was needed to one technology in .NET, you received a notification that an important update was available, even if you were not directly using this part of .NET. You had to decide whether to install this update and endure the disruption to your server or ignore the update and hope that you didn't actually need it.
Features OF ASP.NET 5
ASP.NET 5 is a combination of MVC, web api, and web pages in single programming model.
In ASP.NET 5, MVC, Web API, and Web Pages are bundled into a single framework called MVC 6. This approach removes duplication from the framework and makes it easier for developers to build applications. Hence, no need to write different code depending on whether you are within an MVC, Web API, or Web Pages context.
Ability to use different .net frameworks side-by-side
Generally speaking, when your application depends on a specific version of .NET Framework, all applications within the same domain would need to run the same version of .NET. If you wanted some of your applications to target the latest version of .NET, some legacy applications may need to be re-compiled and modified in order to run properly with the new version of the framework.
To overcome this situation, with ASP.NET 5 you can define the dependencies within your deployment package so you can specify for each application which version of .NET to use. You can enjoy benefits of the latest .NET version for some applications while staying with an older .NET version for other applications. All of these different versions of .NET can be run side-by-side without any conflict.
Ability to self-host or host on IIS
ASP.NET 5 provides the flexibility to host your application on IIS or self-host it in your own process. When you build the application targeting the Core CLR, you can deploy it with every dependency bundled within the deployment package. Hence, your application and its dependencies are completely self-contained and independent of the system installation of .NET. This new capability give you freedom to host your applications on any type of device or hosting platform. All you need to do is just deploy your project to that host.
ASP.NET 5 provides greater flexibility with three runtimes:
- Full .NET CLR: The full .NET CLR is the default runtime for Visual Studio projects. It is the best option for backward compatibility as it provides the entire API set.
- Core CLR (cloud-optimized runtime): The Core CLR is a pure modular runtime for ASP.NET 5 projects. It has been designed in components, so only the required features need to be included in your application. The Core CLR is about 11 MBs instead of around 200 MBs for the full .NET CLR.
- Cross-Platform CLR: A release of a cross-platform runtime for Linux and Mac OS X is coming shortly. When released, this runtime will enable the development and running of .NET applications on Mac and Linux devices. Currently the Mono CLR can be used for cross-platform development.
With ASP.NET 5, a new HTTP request pipeline is introduced which is modular and fast. Using this new pipeline, you will be able to add only the components that are required to run your application. This approach reduces the overhead in the pipeline, so you will get improved output from your application.
Dependency management through nuget package manager
With ASP.NET 5 you can manage dependencies in your projects in a way that there is no need to add assembly references to your project. Instead, you can add NuGet packages through NuGet Package Manager or you can edit the JSON file (project.json) that lists the NuGet packages and versions used in your project. To add dependencies, you can simply type name and version number of the NuGet package into your project.json file.
ASP.Net 5.0 Dependency management through NuGet package manager
The project.json file only includes NuGet packages that are directly added to your project. If you add a NuGet package that is dependent on some other packages, those secondary dependencies are loaded but not listed in the project.json file. This approach will keep project.json file less clumsy and easier to manage. You can add dependency in Project.json file through any text editor.
Cloud-optimized environment configuration
Projects built on ASP.NET 5 are highly optimized for the cloud platform to achieve easy deployment. Visual Studio 2015 introduces a new environment configuration in place of Web.config file. It can request named values from a variety of sources (such as JSON, XML, or environment variables). You can specify values for each environment, and after deployment your app simply reads the correct values.
Open source through the .net foundation, and takes contributions in github
The entire ASP.NET 5 source code is available at GitHub. GitHub will be used as repositories for all development, so you can see what changes were made and when they were made. You can download the code, build your own customized implementations of ASP.NET features and submit changes at GitHub.
No worries for legacy applications
Applications built on earlier versions of ASP.NET will continue to work with the new .NET Framework. You do not need to update or port these applications, if you do not need the new features in ASP.NET 5.
Conclusion
Certainly, Microsoft has made some revolutionary design level changes in ASP.NET 5 to develop modern web applications. One of the most attractive part of ASP.NET 5 is the self contained modular design of the framework the reduces dependencies and unnecessary overhead. The fact that it is fully open source and available on GitHub will, in our opinion, be a good thing for the community, as it enables complete customization and transparency of the platform as well as contribution from a much larger developer base.
Sharing is caring:
WEBSITE-DEVELOPMENT
web development web services web developers asp.net