New Features in C#.Net 5.0

Here are some of the C#.NET 5.0 New Features –

1. Key Features Matrix: Microsoft has published a new version of C# 5.0 beta with CLR version 4.5.

Key Features introduced in C# .Net 5.0

C# 5.0 introduces mainly two key features: Async Programming and Caller Information.

2. Asynchronous functions (Async and Await): Using Async and Await, you can use resources in the .NET Framework, to create an asynchronous method as easily as you create a synchronous method.

Asynchronous methods are the methods that you define using async and await.

Click on this slideshare link for details on new Asynchronous Pattern and Programming.

3. Caller Information: Caller Information attributes provide the information about the caller to a method. You can obtain the file path of the source code, the line number in the source code, and the member name of the caller. Caller Information helps us in tracing, debugging, and creating diagnostic tools.

CallerFilePathAttribute – Full path of the source file that contains the caller. This is the file path used at compile time.

CallerLineNumberAttribute – Line number in the source file on which the method is called.

CallerMemberNameAttribute – Method or property name of the caller.

4. Windows Runtime Support: C# and .NET now have deep integration with the Windows Runtime. C# project can compiled into a WinMD file and then referenced from a HTML/JavaScript project. WinRT’s flavor of COM uses the same metadata format used by the Common Language Runtime. This information is stored in WINMD files that show the structure, though not the implementation, of all the public classes. Windows Runtime returns an HRESULT instead of throwing an exception. For well-known HRESULT values, the corresponding exception is thrown, otherwise a COMException is used.

Read this article for more information on C# and Visual Basic on the WinRT API.

5. Compiler APIs: This feature is supposed to come after C# 5.0 – the APIs will expose whatever knowledge the compiler has about the code to the IDE and the developers, through Syntax Tree APIs, Symbol APIs, Binding and Flow analysis APIs and Emit APIs.

References:

Leave a Reply

Your email address will not be published. Required fields are marked *


5 × two =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>