Monday, May 28, 2012

[.NET 4.5] Some of the features that will be provided by the next version of the .NET framework (2/2)

This is the second part of the series of posts that contain information on some of the new features that will be provided by .NET 4.5.

Windows Communication Foundation (WCF) & ASP.NET Web API

Windows Communication Foundation in .NET 4.5 now supports UDP and also WebSockets. WebSockets will be exposed via the NetHttpBinding or NetHttpsBinding bindings.

Generation of service and data contracts from a WSDL before doing the implementation (“Contract First” development) is now possible. This will greatly enhance WCF productivity.

If you use WCF you certainly know that configuration file management can quickly become a mess (“Configuration Hell”). Too much has to be defined manually, default values are either not existent or not appropriate. This problem has been addressed in .NET 4.5 since WCF configuration has been reworked and greatly simplified. New default values have been added, existing default values have been modified and they seem overall to be much more adapted for production use. This means less manual configuration and reduced need to even touch the WCF configuration !

I already mentioned in my last post that .NET 4.5 is all about asynchrony. So no surprise that WCF has also been enhanced to better support asynchronous scenarios. WCF service methods can now return Tasks and use the new async and await keywords (that now exist in C# and Visual Basic) and true asynchronous streaming is now also supported.

The brand new ASP.NET Web API framework allows you to build HTTP services that are highly interoperable, meaning that they can be consumed by a broad range of clients, including browsers and mobile devices of all sorts.

Some of its features are:

  • Content negotiation: clients and servers can determine together the right format for data to be returned
  • Automatic serialization of data: JSON, XML, and Form URL-encoded data
  • Easily expose REST APIs: map incoming requests to business logic using built-in routing and validation support
  • Query composition: automatically layer on top of IQueryable<T> and enable paging and sorting
  • Support for testing using mocking frameworks
Windows Workflow Foundation (WF)

Windows Workflow Foundation contains many new features I will just point out some of them.

Some of the improvements are:

  • The workflow designer now supports C# expressions
  • The workflow designer is now much more intuitive to use (search, drag-and-drop, multi-select, hierarchical views, etc…)
  • Being able to run different versions of the same workflow side-by-side
  • Better control of how child activities persist in the workflow
  • Improved debugging support and build-time validation
Windows Identity Foundation (WIF)

If you want to use claims-based security and authorization, you have to download Windows Identity Foundation manually and make sure to include it in your deployment packages. WIF is currently released as a standalone library. This will change since it will be integrated into .NET 4.5 and become part of the framework. Its integration will make it much easier and straight forward to use in your projects.

A major enhancement is that session management has been integrated so that custom code is now no longer necessary when trying to use it in a web farms environment. Less custom code means less bugs and less work for the end user.

Visual Studio 11 now fully supports WIF, so that you can test and simulate your implementations at development time.


When talking about ASP.NET I have to talk about ASP.NET MVC4, since it adds so many new and useful functionalities for todays web development (such as support for phones and tables for example). The beta version is available for some time now but the final version will be integrated and shipped with .NET 4.5.

ASP.NET Web Pages will provide the possibility to build device-specific web pages, that are displayed differently based on the device making the request. This allows for optimizing the experience on each device, whether it be on a PC, phone, tablet or any other device.

Without no surprise ASP.NET Web Forms now includes support for HTML5 and its specific elements. Given the fact that HTML5 is actually everywhere this seems just obvious.

But there are much more enhancements ASP.NET Web Forms. Data controls can now be bound to query parameters, to query strings, to form fields, to cookies, to view state, and to session state using strongly-typed binding expressions. This is a new feature called model binding.

ASP.NET now supports and includes:

  • WebSockets providing bidirectional communication over ports 80 and 443 with performance similar to that of TCP
  • Development of asynchronous code
  • Bundling and minimization of JavaScript code for less data transfer, resulting in faster load times 
  • Performance improvements (30% reduction in base level memory consumption)

The Visual Studio 11 code editor has been enhanced to provide good HTML5, JavaScript and CSS3 integration. This makes web development using ASP.NET in .NET 4.5 as productive, intuitive and efficient as possible.


No comments: