Infosys Microsoft Alliance and Solutions blog

« Configuring WCF on IIS 7 | Main | Enterprise systems available on the cloud as services »

.NET Framework 4.0 CLR Enhancements

If you attended PDC and specifically the session on .NET Framework: CLR Futures by Joshua Goodman, GPM, CLR team, then already have a good idea on the new enhancements on their way in the CLR 4.0. In this blog, I will only capture the key points that I found interesting and I do suggest that you watch the video of this session to get the complete message.

1. Better support for side by side, where in you can have CLR 2.0 and 4.0 in the same host process.  This will be specifically useful for addins.

2. No more PIA (primary interop assemblies) to worry about.

3. New signature generation tool that can look up windows.h to generate p/invoke signatures. The tool will be on code plex shortly.

4. .NET supported 16 languages, but no support for dynamic languages and functional language. Iron Python, Iron Ruby and F# will now be supported.

5. Big integers support added in BCL (base class library) so any language on top can leverage it. For more details on BCL changes check here.

6. Tuples supported in F# and Iron Python. It is more used for making new classes or allows functions to return multiple values. This is now added to BCL so langauge interop becomes easy.

7. Tail recursion optimizations done in F#. C# compiler still doesn't support this.

8. .NET Framework now installs faster and applications can startup faster. Installation and NGEN is done in parallel. Startup times improvements due to layout optimizations and can result in upto 40% improvements in some applications.

9. .NET applications can now run from network share with full trust, so it is easy to deploy applications. This feature has been added in .NET 3.5 SP1 itself. 

10. Improvements in threading to take advantage of multi-core machines. Thread pool code improved in conjunction with task parallel library implementation.

11. Support for background GC.

12. Better profiling support with ability to attach/detach performance and memory profilers to production servers without having to install

13. Using catch(Exception e) is bad since it will catch all exceptions include access violation, illegal instruction (exceptions that corrupt the state) etc. Going foward to handle this, you will have to use the [HandleProcessCorruptedStateExceptions] attribute at the function level.

14. Dump debugging simplified by supporting ICorDebug to debug dumps right from Visual Studio. Also new lock APIs are available to help find more details about locaked objects.

15. Code contracts are powerful new constructs that can help write assert and post condition type statements, but in a more powerful manner. Static analysis tools can understand these and identify violations without you even running the code. To know more about code contracts and how they work well with unit testing to help improve the code quality, check this pdc session.

If you want to play around VS 2010 and .NET 4.0, you can download the CTP from here, and can provide your feedback here.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter