Sunday, 5 October 2014

ASP.NET vNext

I have recently been taking a look at ASP.NET vNext
This is particularly interesting with regards to the preview of Visual Studio “14” CTP, which will have support for creating and debugging ASP.NET vNext applications. So what is ASP.NET vNext?
Let me give you a walkthrough of what you can do in this preview.....
ASP.NET vNext has been designed to provide you with a lean and composable .NET stack for building modern cloud-based apps. ASP.NET vNext will build on .NET vNext.
.NET vNext is the next major release of .NET Framework. It will have a cloud optimized mode which will have a smaller footprint as compared to the full .NET Framework. For more details see this post.
ASP.NET vNext can be best described by highlighting the following scenarios
  • Cloud-Optimized
    • ASP.NET vNext can target .NET vNext (with cloud optimized mode). This means that services such as session state and caching can be replaced based on whether the app is running in the cloud or in a traditional hosting environment, while providing a consistent API for developers.
  • Side by side support
    • When targeting the Cloud optimized mode in .NET vNext, ASP.NET vNext will let you deploy your own version of .NET Framework. Since now the .NET vNext Framework can be deployed with the app, each app can run different versions of .NET vNext side-by-side and upgrade separately, all on the same machine.
  • Enhanced developer experience
    • In ASP.NET vNext, you can now edit your code files and refresh the browser to see the changes without explicitly building your app. You can also edit your application outside of Visual Studio.
    • ASP.NET vNext projects have project.json file where all the project dependencies are stored. This makes it easier to open vNext projects outside of Visual Studio so that you can edit them using any editor such as Notepad etc. You can even edit ASP.NET vNext projects in the cloud.
  • A single programming model for building Web sites and services
    • MVC and Web API have been merged into a single programming model. For example, there’s now unified controller, routing and model binding concepts between them. You can now have a single controller that returns both MVC views and formatted Web API responses, on the same HTTP verb.
  • Modular Stack
    • ASP.NET vNext will ship as NuGet packages. NuGet packages will also be the unit of reference in your application. NuGet packages and libraries references will be treated the same so it will be easier to manage the references in your project.
    • This makes it possible for an application developer to choose what functionality they want to bring into their application. In the previous versions of ASP.NET features such as HttpContext, Session, Caching, and Membership were baked into the framework. As an app developer now if you do not need these features then you can choose not to bring it into your app.
  • Dependency Injection
    • Dependency Injection is built into vNext and is consistent across the stack. All of the vNext components such as MVC, Web API, SignalR, EF and Identity will use the same DI. This will allow us to provide the right set of services based on the environment that you are running in.
  • Configuration
    • There is a new configuration system which can read values from environment variables. This configuration provides a unified API system for accessing configuration values. You can use the same APIs to access configuration values locally or in Azure.
  • Open Source
    • The entire source code is already released as open source via the .NET Foundation. You can see the source athttps://github.com/aspnet and follow progress on vNext in real time. You can also send pull requests and contribute to the source code.
  • Cross-platform support
    • We're developing vNext with cross-platform in mind, including an active collaboration with Xamarin to ensure that cloud-optimized .NET applications can run on Mac or Linux on top of the Mono runtime.
The following chart shows the feature set that will be available in .NET vNext and .NET vNext (Cloud Optimized)
vnextfeaturechart

What is Cloud Optimized .NET vNext?

NET vNext will have a cloud optimized mode that enables you to deploy your apps with a copy of the .NET Framework libraries they need. Since the runtime and framework libraries are deployed on an app-basis, each app can run different versions of .NET vNext side-by-side and upgrade separately, all on the same machine. These libraries have been slimmed down significantly to reduce the footprint of the framework, and will be distributed via NuGet.

Summary

This is just a step towards many more awesome features that will be part of ASP.NET vNext. 
We have seen with One ASP a continuous effort to simplify and unify disparate technology under one platform. For instance, you can create a VS project with support for Web API, Web forms, MVC, SignalR with ease.
Do provide any feedback to MS that you for trying out.
Happy coding

No comments:

Post a Comment