Pages

HOME

HOME

Monday, 9 January 2012

New features in .Net 4.0

Here are some new features in .Net 4.0 which are very useful.

  • Application Compatibility and Deployment


      The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions, except for some changes that were made to improve security, standards compliance, correctness, reliability, and performance.
The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework. To run older applications with .NET Framework 4, you must compile your application with the target .NET Framework version specified in the properties for your project in Visual Studio.

The following are some deployment enhancements.
  1. Client Profile

The .NET Framework 4 Client Profile supports more platforms than in previous versions and provides a fast deployment experience for your applications. Several new project templates now target the Client Profile by default.

    2. In-Process Side-by-Side Execution

This feature enables an application to load and start multiple versions of the .NET Framework in the same process(i.e..net 2.0 and 3.5 can be loaded and run in same process). For example, you can run applications that load add-ins that are based on the .NET Framework 3.0 and add-ins that are based on the .NET Framework 4 in the same process. Older components continue to use the older .NET Framework version, and new components use the new .NET Framework version.

    3. Portable Class Library

We can create portable class libraries that run on a variety of .NET Framework platforms without recompiling.

  • Core New Features and Improvements
The following are some new features and improvements in the CLR and the base class libraries.

  1. Diagnostics and Performance

Using .NET Framework 4, we can determine processor usage and memory usage estimates per application domain.
We can observe Memory usage and CPU Usage of individual App domains. App domain resource monitoring is available through the managed and native hosting APIs and event tracing for Windows (ETW).

    2. Globalization

The .NET Framework 4 provides new neutral and specific cultures.It also provides improvements in string handling.

    3. Garbage Collection

The .NET Framework 4 provides background garbage collection. This feature replaces concurrent garbage collection in older versions and provides better performance. 

    4. Dynamic Language Runtime(DLR)

The new System.Dynamic namespace is added to the .NET Framework.This namespace supports the DLR. The dynamic language runtime (DLR) is a new runtime environment.The DLR provides some more services for dynamic languages to the CLR. The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages. 

    5. Tuples

To create the objects that contain the structured data .NET Framework 4.0 provides System.Tuple classes. It also supports generic tuple classes to support tuples that have from one(singletons) to eight(octuples) components. 

  • Some Miscellaneous New Features

1.The new String.IsNullOrWhiteSpace method indicates whether a string is null, empty, or consists only of white-space characters. 
2.Two new convenience methods are available: StringBuilder.Clear and Stopwatch.Restart.