Friday, July 13, 2012

What's New in VS 2012 & .NET Framework 4.5 RC

Hi Folks,

This post is my first blog post after i got back from my vacation in Egypt and getting married! I had a wonderful summer time with my family and here we go back to .NET life style!

After i installed VS 2012 RC on my Development VM and then started to play around with the new IDE. Here are what is called fascinating in the new VS 2012 RC & the framework 4.5.

1) Portable Class Libraries: Now you can develop portable class libraries that can be used to target different framework ranging from .NET framework, Silverlight and Windows Phone 7 or even XBOX 360!!.

Even this is a great option in VS 2012 but please note that also you don't have an option to add references that are not compatible with targeted frameworks.

For example, if you tired to add a .NET framework assembly in portable class library you will find very few assemblies are available, check out below screen shot.

Note: If you tried to add any references that is not compatible with your targeted platforms then VS 2012 will warn you with incompatibility warning!

Read more about Portable Class Library:

2) Asynchronous File I/O
Now you can develop code for intensive I/O operations without blocking the main thread!. with that being said, new keywords in C# and VB.NET have been added and supported by the compiler through using async and await keywords which are available in C# and VB.NET.

public async Task CopyFilesAsync(StreamReader Source, StreamWriter Destination)
    char[] buffer = new char[0x1000];
    int numRead;
    while ((numRead = await Source.ReadAsync(buffer, 0, buffer.Length)) != 0)
        await Destination.WriteAsync(buffer, 0, numRead);

Read more about Async File I/O in .NET 4.5:

3) Web: Supports for HTML5,Async http request and response, WebSockets & support for CDN in Script Manager fallback.

4) Enhancements in WCF including: easier compatibility mode, HTTPs endpoints with IIS, Generate WSDL by appending ?singleWSDL, Simplification for generating configuration files and more.

5) Enhancements in Windows Workflow Foundation (WF).

6) Enhancements in Windows Presentation Foundation (WPF): A new Ribbon control, New INotifyDataError Interface and more.

Read more about what's new for WPF in .NET 4.5:

7) Metro Style Applications
You can now build Metro Style application using VS 2012, A subset of .NET 4.5 is available when building Metro Style Applications and its called .NET APIs.

To get an overview about Metro Style applications:

- Reference:
What's new in .NET Framework 4.5:

Have Fun with VS 2012 RC and hope this helps!

Have a wonderful weekend everyone.

Mostafa Elzoghbi

No comments: