What’s New in the .NET Framework 2.0?
In this tutorial you will learn about new feature in .NET Framework 2.0. Various aspects such as Support for 64 bit platform application development, Access control list support (ACL), ADO.NET, ASP.NET, Authenticated streams,COM Interop Service Enhancements, Console Class Additions, Data Protection API, Detecting changes in Network connectivity, Disjunctive Demands, Distributed Computing, EventLog Enhancements, Expanded Certificate Management, FTP Support, Generics and Generic Collection, I/O Enhancements and several other feature are discussed here below.
The Microsoft.NET framework of Version 2.0 extends the .NET framework of Version 1.1. It was developed under the code name ‘Whidbey”. Whidbey includes the .NET framework, various user interface types such as Windows forms, ASP.NET and the compact framework. It also includes the official languages C#, Visual Basic.NET and J# and the Development environment. In this section we shall focus on the main changes brought into the .NET framework by the 2.0 version.
Support for 64 bit platform application development. These applications can run faster and take advantage of more memory that is available and users can build managed code libraries or easily use unmanaged code libraries on 64.bit machines.
Access control list support (ACL). This is used to grant or revoke permission to use a particular resource on a computer. Several new classes have been added to the .NET Framework to enable manage code to create and modify ACL. Members that use ACL have been added to the I/O, registry and threading classes.
ADO.NET now supports user defined types, asynchronous database operations, XML data types, large value types, snapshot isolation, and has attributes that allow applications to support multiple active result sets(MARS) with SQL Server 2005.
ASP.NET has received most attention. A number of new features have been added to ASP.NET such as new controls for development of dynamic web pages. New Data controls for displaying and editing data that do not require the user to write code add to the ease of application development. The code behind model developed for use in ASP.NET makes it more robust. New caching features such as ability to cache dependency tables in SQL server database have been introduced. The current version allows users customize web pages in a number of ways. Property values for individual user profiles can be automatically tracked. Web parts can be used to allow users customize their pages in the browser. Navigation menus using simple controls can be added. Master pages enables users create layouts for all pages in the site and themes allow him to define a consistent look and feel for the site. The Web site can be precompiled to produce an executable code from source files. The resulting output can be displayed on a production server. ASP.NET enhancements also include new tools and classes which make website management easier and comprehensive. A wide variety of browsers are accommodated in ASP.NET and by default controls render output that is compatible with XHTML 1.1 standards. The device filter can be used to specify different property values for the same control on different browsers.
Authenticated streams is the new class introduced into the .NET Framework to enable users transmit secure information between a client and a server. The System.Net.NegotiateStream and System.Net.SslStream are classes which authenticate the transmission of data. These stream classes support mutual authentication, data encryption and data signing. The System.Net.NegotiateStream class uses security protocol for authentication while the later uses the Secure socket layer for authentication.
COM Interop Service Enhancements include enhancements that have been made to classes and tools that support interoperability with COM. These enhancements are of four kinds.The System.Runtime.InteropServices.SafeHandle and System.Runtime.InteropServices.CriticalHandle classes and the derived classes are designed to provide safe and reliable means of manipulating the operating system handles.Enhancements to interop marchaler has given the user the ability to wrap native function pointers into delegates and to marshal fixed size arrays of structures inside structures. The performance calls between applications in different domains have been fine tuned. Type Library Importer and Type Library export switches have eliminated the dependency on the registry for resolution of type library references.
Console Class Additions of members to the System.Console Class enable the manipulation of dimensions of the console window and screen buffer. This is extremely useful for creation of animations which require moving a rectangular area of the screen buffer. Other new members in this class help control the foreground and background colors of texts, the visibility and size of the cursor and the frequency and duration of the console beep.
Data Protection API has been expanded with the inclusion of four new methods that allow applications encrypt passwords, keys, connection strings and so on. Blocks of memory can also be encrypted if the operating system is Windows Server 2003 or above.
Debugger Display Attributes have been tweaked to give the user control over how the class is displayed in the debugger. The user can now identify the most useful information he needs to display in the debugger and make the required settings for the same.
Debugger Edit and Continue Support is reintroduced into 2.0 .NET Framework to enable users who are debugging applications to make changes to source code while executing in the break mode. The user can now make the changes, resume the execution and observe the effect. This feature is available in all languages.
Detecting changes in Network connectivity is enabled by the use of the System.Net.NetworkInformation.NetworkChange. The user can now receive notification when an Internet Protocol (IP) address of a network Interface changes. This can occur due to disconnected network cable, hardware failure etc.
Disjunctive Demands allows multiple code identities to access a class or method. The new security actions that have been created allow multiple identity permissions to be simultaneously demanded, inheritance demanded or link demanded. The DemandChoice security action now allows the user demand several strong name identities to allow the stack walk to succeed. The InheritanceDemandChoice and LinkDemandChoice are the two other security codes that have been introduced in this version of Visual Studio.NET.
Distributed Computing gives support for FTP client requests, caching of HTTP resources, automatic proxy discovery, and obtaining network traffic and statistical information. The Web server class has now been added to the namespace and this can be used to create simple web server for responding to HTTP requests. Output trace information for application debugging and diagnostics are generated by classes. Performance and security enhancements have been added to the System.Net.Sockets.Socket and System.Uri classes. Support for SOAP 1.2 and nullable elements have been added to System.Web.Services. Channel security features have been added to System.Runtime.Remoting.Channels. Authentication, encryption and load balancing are now supported by the TCP channel.
EventLog Enhancements enable the use of custom DLLs for messages, parameters and categories.
Expanded Certificate Management now supports X.509 certificate stores, chains and extensions. Certificates can be signed and verified without platform invoke using X.509 certificates. PKCS7 signatures, encryption and CMS are also supported
FTP Support is now integrated into 2.0 with the introduction of the classes System.Net.WebRequest, System.Net.WebResponse and System.Net.WebClient.
Generics and Generic Collection allow the user create flexible, reusable code. The generics act as templates that allow classes, methods, structures, interfaces and methods to be declared and defined with an Unspecified parameters. The types are specified only when the generic is used. System.Namespace and System.Collections.Generic provide the generic classes and methods. While the latter namespace supports strongly typed collections, System.Nullable
Globalization has been extended with five new features to support custom cultures and languages. Minor customizations of existing cultures or creation of new cultures becomes possible with the new .NET 2.0. Encoding and decoding are done by mapping a Unicode character to and from a stream of bytes that are transferred to a physical medium such as a disk or communication line. Failure to complete the mapping operation can be compensated using the new encoding and decoding fallback feature supported by several classes in the System.Text Namespace. The .NET framework also supports the latest normalization standard defined by the Unicode consortium and the process converts character representations of text to a standard form that can be compared for equivalence.
I/O Enhancements have made the various I/O classes usable and functional. Users can now read and write text files easily and obtain information about a drive if needed. The System.IO.Compression namespace helps read and write data with the GZIP compression and decompression standard described by the IETF REC 1951 and RFC 1952 specifications.
Manifest Based Activation provides support for loading and activating applications using a manifest. This is essential for ClickOnce applications which use the manifest to load the application as against the traditional usage of the assembly to load the application.
.NET Framework Remoting now supports IPv6 addresses and the exchange of generic types. The process of authentication and encryption is supported by System.Runtime.Remoting.Channels.Tcp namespace. The System.Runtime.Remoting.Channels.Ipc permit applications in the same computer communicate with each other without using the network. A connection cache time out can be configured and the number of method retries can be set to improve network performance where remote clusters are involved.
Local computer Network configuration and Usage Information can be obtained by using the classes in the System.Net.NetworkInformation namespace. IP, IPv4, IPv6, TCP and UDP network traffic statistics can be obtained. Local computers network adapter information can also be viewed by users.
Ping enables the user verify whether a remote computer is accessible over the network. The System.Net
Processing HTTP requests from within applications. The System.Net.HttpListener class can be used to create a simple web server that responds to HTTP requests. This web server remains active so long as the application is live and is available only on applications running on Windows XP with Service Pack 2 or Windows Server 2003
Control of Caching can now be done programmatically using the System.Net.Cache namespace. Applications can control the caching of resources obtained using System.Net>WebRequest, System.Net.WebResponse and System.Net.WebClient classes. The .NET framework provides predefined cache policies or the user can specify a custom cache policy for each request.
Programming Languages: A number of changes have been brought into the programming languages used with the .NET framework such as Operator overloading , partial classes, generics, xml documentation, New data types and New keywords in VB.NET and generics, Iterators, anonymous methods and Partial classes in C# . We will study the changes brought into ASP.NET and C# in some detail later in this series.
In this section of the tutorial we have listed out and briefly defined some the major changes that have been wrought into the .NET Framework. The direction of the change was to ensure that developers are freed from writing codes for 70% of the functionality required for their application. The idea was to help them develop in the language that they are familiar with and at the same time provide them with interoperability features that make the language selected seamlessly integrate with other languages of the .NET framework. In the sections that follow we shall examine the impact of these changes on how developers work within the new .NET framework.