Wednesday, August 14, 2013
C# 5.0 New Features
1. Key Features Matrix: Microsoft has published a new version of C# 5.0 beta with CLR version 4.5.
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.
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.
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:
Labels:
C# 5,
C# 5.0,
New Features
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment