Wednesday, October 17, 2012

[Tutorial] Test Driven Development with Visual Studio 2012
Part2: New features in Visual Studio 2012 (1/2)

The last blog post in the series introduced Test Driven Development (TDD). This blog post is going to talk about some of the new features in Visual Studio 2012, that allow you to successfully apply the TDD approach in your daily work.

Visual Studio 2012 external test framework support

The previous version Visual Studio 2010 already provides the possibility of using external test frameworks. But unfortunately with multiple limitations such as:

  • Dependency on third party applications for being able to execute unit tests. For example Gallio needs Icarus Runner if you want to run your unit tests.
  • Code coverage analysis does not work natively, only by using third party products (such as NCover for example).
  • Execution of unit tests is specific to certain plugins : for example there is a difference if you run your MSTest unit tests from within Visual Studio 2008 or by using Resharper, which may result in problems when trying to apply continuous integration processes.

As you can see, you have to multiply plugins and tools, that might not always be compatible with each other, when using Visual Studio 2010 with external test frameworks. Really not an optimal situation, when you want to benefit from specialized external test frameworks and their advanced functionalities !

One of the major updates of Visual Studio 2012 is the support of several external unit test frameworks for multiple languages without any of the limitations mentioned above.

Here are some of the unit test frameworks that you can now use easily:

For .NET :

For Javascript/HTML :

For C++ :

How to use NUnit as external test unit framework 

Lets see how to use NUnit as external test unit framework. First you have to install NUnit (currently as Prerelease) via NuGet.

Fig2_NUnit

Then you have to install the test adapter plugin for NUnit (currently as Beta) via the Extension Manager, which you can now find under “Tools/Extensions and Updates…”. Note that all test adapters are free of charge and that the functionality to search and download those adapters is fully integrated in Visual Studio 2012.

Fig4_Menu

Fig3_Extensions

After installing the NUnit test adapter plugin, you are able to use all Visual Studio 2012 unit test functionalities together with NUnit. You may for example execute your NUnit unit tests directly from within the Visual Studio 2012 IDE, display the test results in the standard view “Test Explorer” and run a code coverage analysis on your code.

Fig5_CodeCoverage

Support for C++ in native MSTest

Another big feature of Visual Studio 2012 is that it now supports native MSTest unit tests for C++ applications. Good news for C++ developers, who may now also apply Test Driven Development using native MSTest as unit test framework.

Fig6_NativeUnitTestProject

Following is an example implementation of a unit test in Visual C++ using the native MSTest unit test framework:

image

Support for async and await in VS 2012 and its unit test framework

Windows 8 and .NET 4.5 introduce a major feature that will have a high impact on software development as we know it: Asynchronous Programming. Visual Studio 2012 and its unit test framework support this new approach perfectly. The async and await keywords, available in .NET 4.5, may now be used for creating unit tests of asynchronous methods.

Lets say that you want to create a unit test for the following asynchronous example method:

16-Oct-12 16-49-01

The corresponding NUnit test method could be:

16-Oct-12 17-09-08

In my next blog post I am going to further show you other new features of Visual Studio 2012, which will make your life easier when trying to apply Test Driven Development.


Share/Save/Bookmark

Thursday, October 11, 2012

[Tutorial] Test Driven Development with Visual Studio 2012
Part1: Introduction to TDD

In one of my blog posts series, I showed you how to increase the quality of your code and how to make it much easier to maintain by applying the S.O.L.I.D. principles. I then focused on the Liskov Segregation Principle (LSP) by using Code Contracts in .NET 4.0. This blog series is going to talk about Test Driven Development (TDD) in an Agile environment using the latest Visual Studio 2012 features and how that is going to help you to be more efficient and productive.

The goal of this series will be to show you some of the new features within Visual Studio 2012, that are going to help you when trying to apply the TDD approach. The first parts of the series are more theoretical, while as the last part will be fully practical, since we are going to implement some example code using TDD.

Contrary to traditional software development methodologies and processes, where writing unit test is often done as last step after code implementation, TDD consists of writing unit test upfront as first step in the software development cycle. No development can be started without having implemented the corresponding unit tests. You understand that TDD has large impacts on the organization of your teams.

The following are the different steps when applying Test Driven Development :

image

  1. Write a unit test for a new functionality, then validate that the test fails, since its implementation has not been realized
  2. Implement the minimum code necessary to pass the test, then validate that the test passes successfully, meaning that the expected behavior is now provided by the implementation
  3. Refactor and optimize your code, the unit tests ensure the coherence of the functionalities

Using TDD helps in obtaining a code source that is very reliable, predictable, robust - and after refactoring - highly optimized. Unit tests ensure a correct behavior, independently from where it is going to be used, resulting in a code source that will work as expected under any circumstances.

For being able to create good unit tests, you have at first to think about the conception and software design of your application. You must not hurry into doing your implementations, before being clear about your objectives (which should be true for any development, but sadly often it is not).

Conceptual errors can be detected and resolved much quicker and in a much more efficient way. As explained the implementation is started only after the conceptual phase has been validated and tested via thorough unit tests. In this case, your unit tests become much than just tests. They become some sort of general specification, describing  “units of functionality” for your application.

When refactoring and optimizing your code, you may restructure your code without any risks, since all your modifications are now verifiable. Unit tests ensure that there are no technical or functional regressions and furthermore the coherence of behavior. They validate that your application will always behave in the same way, if they are executed with success.

Additionally if you combine TDD with Extreme Programming (XP) and pair programming, you obtain a code with a very high degree of quality.

The next blog post in the series is going to talk about some the new features in Visual Studio 2012, that allow you to apply TDD quickly and easily, stay tuned!


Share/Save/Bookmark

Monday, October 1, 2012

[Publication] Article in French Programmez Magazine on Window 8 Development and how to build your first application

You can find an article of 3 pages on how to start developing applications for  Windows 8 in the French Programmez magazine No.156 written by Jonathan Pamphile and me.

First Page and Second Page (low resolution)

Third Page (low resolution)

The article is written in French but as always I will write some English articles on my Blog in the next weeks. So stay tuned if you are interested in getting to know how to start programming application for Windows 8 and publish them on the Windows Store.


Share/Save/Bookmark

Monday, September 3, 2012

[Publication] Article in French Programmez Magazine on Test Driven Development with Visual Studio 2012

You can find an article of 4 pages concerning Test Driven Development with Visual Studio 2012 in the French Programmez magazine No.155 written by me and Fathi Bellahcene.

00001

First Page and Second Page (low resolution)

Third Page and fourth Page (low resolution)

The article is written in French but as always I will write some English articles on my Blog in the next weeks. So stay tuned if you are interested in getting to know how to start using Test Driven Development (TDD) with Visual Studio 2012 when building your applications.


Share/Save/Bookmark

Saturday, August 11, 2012

[Certifications] Now ITIL V3 Foundation certified !

Just to let you know that I passed the ITIL V3 Foundation exam lately. I am happy to announce that I am now ITIL V3 certified !

For more information concerning ITIL please consult the official ITIL website of the APMG Group : http://www.itil-officialsite.com/.


Share/Save/Bookmark

Wednesday, August 8, 2012

[VS 2012 - .NET 4.5] Visual Studio 2012 & .NET 4.5 RTM in August

The RTM-versions of Visual Studio 2012, .NET 4.5 and Windows 8 will be available in less than a week on 15 August 2012. This is a very important date for all you developers out there !

image

image

Developers subscribing to MSDN will be able to download the Windows 8 RTM version on August 15. Microsoft announced that Visual Studio 2012 and .NET Framework 4.5 will also be available via MSDN on the same date.

Note that the RTM-versions (release to manufacturing) contains already everything that the final version for the customers will contain ! So from this date on you may validate your applications in a real production environment.

In the meantime download the Release Candidate versions and Release Preview versions and familiarize yourself with all the new features of those products.


Share/Save/Bookmark

Thursday, July 19, 2012

[C# and EF] Tutorial: Entity Framework Code First Migrations 2/2

This second part of the series shows how to activate EF Code First Migrations and either handle them manually in code or – even more interesting - letting EF handle them automatically for you.

Manual Code-based EF Code First Migrations

The first possibility is to handle those changes manually from within your code. Here is how that works.

  • Open the Package Manager Console from the Tools menu within Visual Studio 2012.

image_thumb2

  • Activate the manual EF Migration features by entering the command “Enable-Migrations”.

image_thumb4

  • This adds a new folder Migrations and also the auto-generated classes Configuration.cs  and [SOMEDATE]_InitialCreate.cs to your project.

image_thumb5

  • The Configuration.cs class allows you to configure the EF Code First Migrations options and seed data after migration (very useful for testing purposes during development).

image

  • The other class contains all the code necessary to create the database (Up) and also drop it (Down) if necessary.

image

  • Here is an example of what can be found in the Up() method.

image

  • Here is an example of what can be found in the Down() method.

image

From here you may start to implement you own code in C# for handling EF Code First and database schema changes.

Automatic EF Code First Migrations

Being able to handle database schema changes related to EF Code First changes from C# code is great, you won’t need to be an expert of database development anymore. But you still need to know what to change and you still need to allocate some time for it.

What if there would be a fully automated way of handling those changes without any effort? Well there is and you just have to activate it. Here is how that works.

  • Open the Package Manager Console from the Tools menu within Visual Studio 2012.

image_thumb2

  • Activate the automatic EF Migration features by entering the command “Enable-Migrations -EnableAutomaticMigrations”.
  • If you try that on a project where you have already activated the manual EF Code First features, you just need to delete the Migrations folder first.

image

  • If you look into the Configuration.cs file you will see that the flag to activate automatic migrations is now enabled.

image_thumb7

  • When you now change the EF Code First model as explained in the first post of the series, you may start the automatic migration of the database via the Package Manager console by entering “Update-Database”.

image

  • And you see that the automatic migration was not applied because it would result in data loss. By default it is not allowed to apply automatic migrations if there is data loss implied. This is a security feature to not accidently delete important data from the database. Mind that you may revert back to an old database schema but you won’t get back deleted data!
  • So now it is up to you to either review the changes or allow automatic migrations if there is data loss (really use this with percaution!!).
  • To allow data loss you just set the flag AutomaticMigrationsDataLossAllowed to true in the Configuration constructor.

image

  • When you restart the automatic migration of the database via the Package Manager console by entering “Update-Database” (you may want to add the “–Verbose” flag) you see all the changes that were applied.

image

  • You can now use your application as expected. The modifications in the database reflect the EF Code First model changes.

Share/Save/Bookmark

[C# and EF] Tutorial: Entity Framework Code First Migrations 1/2

I showed you how to use the Entity Framework Code First approach in one of my last blog posts. This approach is very useful if you want to begin with the implementation and there is no database yet. You want to concentrate on the code and not worry about the database at all, therefore letting Entity Framework auto-generate the database for you.

This is especially interesting for developers not having too much experience in database development or in cases where you have to deliver very quickly and you just don’t want to bother with database design.

The problem : Lack of handling Code First model changes in the DB

Code First works very well and is very easy to use. But it lacks an important feature as I have already pointed out in one of my other blog posts – the handling of database schema changes (add/delete/modify columns, add/delete/modify data types, add/delete/modify constraints, etc…) related to EF Code First model changes .

When you change the underlying EF Code First model expressed in your code (via POCO classes for example) and/or its restrictions you either have to re-create the whole database, meaning that all your data gets lost in the process (not acceptable in production use), or code the database changes manually via SQL upgrade scripts.

In this case the developer still needs to have good database development skills and spent time to create, test and execute the upgrade scripts. This is a tedious task, which the new version of Entity Framework 5.0 integrated in .NET 4.5  is going to greatly simplify and automate.

The solution: Code First Migrations

Microsoft heard the customer requests concerning this problem and added what is called Entity Framework Migrations. It is very easy to activate, and though not perfect, serves very well for applying necessary database schema changes if you work with EF Code First.

Let me show you how it works by providing an example in Visual Studio 2012.

  • Create a new project (for the example a console project but you may as well use any other type of project).

image

  • Now do a right click on the project in the Solution Explorer and select to manage the NuGet packages for it.

image

  • In the Nuget packages window search for Entity Framework and select version 5.0 (currently as a release candidate, this won’t be necessary in the future since it will be fully integrated in .NET 4.5).

image

  • This will allow you to use Code First and do an example implementation : a POCO class Person.
  • When you run your application and use the DataContext, the database and all its columns and constraints get automatically generated. Everything works fine and your application works as expected.

image

  • Now you get an application change request and you decide to change the EF Code First model by changing the POCO class.

image

  • But if you try to change the underlying POCO classes of an already generated database and execute your application, you will get the following exception.

image

  • This is the expected behavior since the new EF Code First Migrations features are not activated by default. You have to activate them manually and configure them according to your needs.
  • To do this open the Package Manager Console from the Tools menu within Visual Studio 2012 and activate the EF Code First Migration features from there.

image

In the next part of the series I am going to explain how to activate either the manual or the automatic features of EF Code First Migrations so stay tuned.


Share/Save/Bookmark

Saturday, June 30, 2012

[.NET 4.5] Windows Identity Foundation 4.5 in NET 4.5

Windows Identity Foundation 4.5 (WIF) is a framework for building identity-aware and more specifically claims-aware applications. It furthermore provides an abstraction  to the underlying protocols (ex: WS-Trust, WS-Federation, etc …) and therefore encapsulates and standardizes application security.

Developers do not need to know how to exactly implement and use those protocols anymore. Instead they may use API calls to the WIF Toolkit for implementing secure applications, thus resulting in applications which are loosely coupled to their security implementations. Tokens issued from a large scale of different security providers (including  ADFS 2.0, ACS and custom Security Token Services) can be handled.

The default configuration and behavior works great and with ease you will be able to implement it in no time. But the best of all : the WIF Toolkit is highly customizable. You may completely override and customize the default behavior on some or on all the step of the process (Protocol Module, Session Module, Claims Authorization Module, Token, STS, etc..).

WIF in its first version (1.0) is available as a runtime and as an external SDK for .NET 3.5 and .NET 4.0. You have to install it separately for being able to using it in your applications. The WIF Training Kit contains everything necessary to start with claims based security (explication, tutorials, examples, etc…).

WIF 4.5 and .NET 4.5

So what’s new in WIF 4.5 ? Well first of all WIF is now part of the .NET framework. You do not need to install it manually anymore. It is shipped and installed with .NET 4.5, which means that it is now an integral part of the framework ! Most of the classes and methods are now part of Mscorlib.dll !

Also it is now much easier and straightforward use WIF and to query for claims. Let me show this in the following example.

Create a new web application, right click on your project in the Solution Explorer and select "Identity and Access…” from the list.

ProjectMenu

You will see a new configuration wizard, which will guide you through the process of setting up a STS reference. You may either use a development STS, a business provider based on ADFS2 or Windows Azure Access Control Service (ACS).

For the example I use the development STS :

AuthenticationOptions

You may now run your web application and the development STS gets started automatically. When you see the little icon in the tray area you know that everything working correctly.

LocalSTS

Now lets see how to query for a claim by using the ClaimsPrincipal in the System.Security.Claims namespace and calling its FindFirst(…) method.

ClaimEmail

Where you had to write at least 3 lines of code and do casting operations in WIF 1.0, you now have everything in a single line ! Much easier to implement, to understand, to maintain and also to extend !

Note that there are a variety of other utility methods to aid you in working with claims (FindAll, FindFirst, HasClaim, etc…) and that you have access to almost everything just by using the  ClaimsPrincipal.

Another improvement is the seamless integration of WCF 4.5 and WIF 4.5. You now can use both together much more easily. Custom service host factories or federation behaviors are not needed anymore. This can be achieved via the useIdentityConfiguration switch.

WIF 4.5 and WebFarms

Great news for all developers using WIF in a WebFarms environment (including  Windows Azure). With .NET 4.5 it is finally possible to use WIF without implementing complicated and time consuming workarounds to encrypt your WIF cookies with a single encryption key.

You just configure a new MachineSessionSecurityHandler by setting it in your Web.config file and it will work without any further changes ! This has even been added to the wizard as a checkbox ! How easy is that compared to the old way of resolving this problem !

image

WIF 4.5 and Windows Server 2012

Windows Server 2012 Domain Controllers are going to support the claims based model and provide extra claims via Kerberos (User Claims and Device Claims), which you may then query for within your WIF 4.5 implementations. This is actually a quite interesting feature. I might do another blog post and give  you more details on that in the next weeks.

WIF 4.5 and Visual Studio 2012

The integration of WIF tools has been completely re-designed, as you saw in my quick example above. This has been done to simplify the whole process and to render it much more comprehensive. So it is now easier to understand with less steps and quicker configuration.

As you saw above the new tools contain a local development STS which simulates a real STS (comparable to the development fabric within the Windows Azure SDK). The development STS is by the way completely configurable (Token format, port, test claims, etc..).

Furthermore, the WIF 4.5 tools and all samples are now distributed as VSIX via the Visual Studio Extensions Gallery.

Conclusion

As you can see WIF 4.5 has been greatly enhanced and industrialized. It will become the the primary choice when working with application security. Come on and give it at try,  test all these new features by downloading the Windows Identity Foundation Tools for Visual Studio 2012 RC.


Share/Save/Bookmark

Monday, June 18, 2012

[.NET 4.5] Portable Class Library (PCL)
How to write code that runs on all .NET platforms

The Portable Class Library project in .NET 4.5 allows you to share source code easily between different technologies, which are based on the .NET framework (Windows, Windows Phone, Silverlight, XBOX 360, Metro).

Very helpful if you need to share common algorithms (for validation purposes for example), common interfaces and common data objects between applications based on those different technologies. Using the PCL in this case provides consistency and encapsulation of your code independently from the place where it will be used. Thus resulting in less maintenance costs and higher productivity for your teams.

You have to note however that the PCL only allows using a common sub-set of all features provided by those different technologies. This makes perfectly sense since not all features are supported by each technology.

Now lets see how to use the Portable Class Library from within Visual Studio 2012. First of all you have to create a new project of type Portable Class Library.

PCL_Project

You may then select the target frameworks, where the code needs to run on and the solution gets created by Visual Studio 2012 in the next step.

If you build your solution the resulting DLL is useable by the target frameworks without any additional configuration or modifications, you just add a reference to it and you can use the common code.

Platforms2

You may modify the frameworks you want to target in your existing PCL projects after project generation anytime. For that you have to open the project setting and you may add or remove target frameworks from within the Library section.

ChangePlatforms

Other targeting packs are available for Visual Studio 2012. They may include Visual Studio updates and must be installed with the corresponding runtime versions most of the time.

Those are the additional targeting packs currently available:

  • .NET Framework 4.0.3
  • .NET Framework 4.0.2
  • .NET Framework 4.0.1
  • .NET Framework 4
  • .NET Framework 2.0/3.0/3.5 SP1
  • Windows Azure (via SDK)
  • XNA Game Studio 4.0

You can download them from here:
http://msdn.microsoft.com/en-us/hh487283.aspx

Examples using VS 2012 and VS 2010:

In the following very basic example I am going to show you a real example of how to use the PCL. Lets say that you have some business rules that need to be validated in your applications. Those business rules won’t change if you use a Windows Application, a Windows Phone application or a Metro Application. So it makes perfectly sense to have them developed in a common place.

The class diagram shows the structure of a Validator class, that validates Rules which are based on expressions. This is a quite straight-forward approach on how to implement business rules validation.

As explained before we create a PCL project and implement all those classes, interfaces and validation code in this project.

We then create a common DLL that is used in the different application project, which are based on completely different technologies.

ClassDiagram

Lets start with a Silverlight application created within Visual Studio 2012. Create a new project of type Silverlight Application.

SilverlightProject1

Select Silverlight 5 for this example but note that you could also create a Silverlight 4 project and use the PCL if you wanted to.

SilverlightProject2.

Here is a very basic example of the usage of the common classes, that are defined in the common code assembly, in the newly created Silverlight project. The project builds successfully and you can reuse all interfaces, classes and algorithms, that you have defined in the common code assembly.

CommonCodeInSilverlight

The following example shows how to use the common code library in a Windows Phone 7 application, being developed using Visual Studio 2010. After installing the Windows Phone 7 SDK, add a new project of type Windows Phone Application and add a reference to the common code library.

PhoneProject1

Select Windows Phone OS 7.1 for this example but note that you could also create a Windows Phone 7.0 project and use the PCL if you wanted to.

PhoneProject2

Here is a very basic example of the usage of the common classes, that are defined in the common code assembly, in the newly created Windows Phone project. The project builds successfully and you can reuse all interfaces, classes and algorithms, that you have defined in the common code assembly.

CommonCodeInPhone71


Share/Save/Bookmark

Thursday, May 31, 2012

[.NET 4.5] Release Candidates of .NET 4.5, VS 2012 and TFS 2012 as well as Windows 8 Release Preview were released today

The Release Candidate of .NET 4.5 was released today together with Visual Studio 2012 Release Candidate (working name VS11), Team Foundation Server 2012 Release Candidate and a brand new Windows 8 Release Preview.

You can download .NET 4.5, Visual Studio 2012 as well as TFS 2012 here.

image

You can download the Windows 8 Release Preview here

image

Note that you may also download all those versions from MSDN if you have a subscription.

For more information on what’s new in the RC of Visual Studio when comparing to the beta you can read Jason Zander’s blog post.

If you want to evaluate all the new features and test the new versions you should quickly download and install them in a testing environment. Remember however that you should not use them in any production environment since the final versions still could change and since you won’t get any support for Release Candidates.


Share/Save/Bookmark

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.

ASP.NET

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.


Share/Save/Bookmark

Friday, May 18, 2012

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

The next release of the .NET framework integrates many new features to enable high productivity, good performance and support for all kinds of display devices (PC, mobile, browser, tablets, etc…).

The .NET framework has been reworked and ameliorated on almost all levels from the bottom to the top (CLR, BCL, EF, WCF, WF, ASP.NET, etc…)  to build this new version 4.5.

Common Language Runtime (CLR)

The Garbage Collection extensions named background Garbage Collection that were introduced in .NET 4.0 are further optimized and fine-tuned in .NET framework 4.5.

Large object are allocated on the Large Object Heap. The .NET framework 4.5 contains significant performance improvements, including better algorithms for free memory management of the Large Object Heap. This is especially interesting when using 64 bit processes. Additionally arrays in 64 bit processes may now be larger than 2GB.

Another improvement in the runtime is the support of optional background multi-core JIT compilation to improve application performance.

Several new features were added for parallel computing including improved performance, increased control, a new dataflow library, and improved support for parallel debugging and performance analysis.

Base Class Libraries (BCL)

The new version of .NET is all about asynchrony. Many new async methods were added to the BCL (for example in the following libraries mscorlib.dll, System.Xml.dll, System.Data.dll, System.Web.dll, System.Net.Http.dll). The performance of existing types in the framework was highly optimized.

At last .NET 4.5 contains its own ZIP implementation. No need to to this manually or use an external library such as SharpZipLib anymore. The new ZipFile and ZipArchive classes are introduced for manipulating ZIP files efficiently.

Furthermore the Managed Extensibility Framework (MEF) now supports generic types, multiple scopes, and a convention-based programming model.

Entity Framework 5.0 (EF)

The final release of Entity Framework version 5.0 (currently in version beta2) will be included in the .NET framework 4.5.

Some of the new features are:

  • Enum support for Model First, Database First and Code First
  • Table-Valued functions in the database using Database First
  • Spatial data types in Model First, Database First and Code First
  • Multiple performance enhancements (improvements for some queries of up to 600%)
  • Automatically compiled LINQ queries (.NET 4.5 supports the automatic caching of query compilations)
  • Usage of LocalDb instead of SQLEXPRESS for Visual Studio 11

Share/Save/Bookmark

Monday, April 2, 2012

[MVP Nomination] One more year as MVP Visual C# !!!

I got an email yesterday from Microsoft containing the info that I am awarded Microsoft MVP Visual C# again for 2012. I am very happy and honored for being selected again and proud to call myself MVP for one additional year !!!

image

I want to take some time and thank my MVP Lead for having me nominated.

Also a big thank you to Microsoft for putting their trust in me. I will do my best and continue sharing my knowledge with the community. So be prepared for many new blog posts and articles in the technical press on Software Architecture & Design, Visual C# and Windows Azure, which are my main interests. I will also continue concentrating on speaking at conferences so I would be glad to see you at any Microsoft events (TechDays, MS Days, etc…).

Stay tuned and continue following me if you like this Blog !


Share/Save/Bookmark

Thursday, March 15, 2012

[Webcast] Migrate your .NET applications to Windows Azure

I will present a webcast the 30th of march 2012 with Microsoft in French on how to successfully migrate your .NET applications to Windows Azure entitled “Migrez vos applications .NET sur Windows Azure”.

So if you are interested in this topic and you understand the French language don’t hesitate and inscribe yourself to this free webcast:

image


Share/Save/Bookmark

Thursday, March 8, 2012

[TechDays 2012] Videos of my two Azure sessions are now online

The videos of my two Windows Azure sessions, presented with some colleagues and Microsoft during TechDays 2012, are now online. You can watch them below if you understand the French language.



Share/Save/Bookmark