The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components...
Transcript of The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components...
![Page 1: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/1.jpg)
NET Framework Developer's Guide
Overview of the .NET FrameworkThe .NET Framework is a new computing platform that simplifies application development in the highly
distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives:
To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
To provide a code-execution environment that minimizes software deployment and versioning conflicts.
To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party.
To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments.
To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications.
To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.
The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.
The .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code, thereby creating a software environment that can exploit both managed and unmanaged features. The .NET Framework not only provides several runtime hosts, but also supports the development of third-party runtime hosts.
For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for managed code. ASP.NET works directly with the runtime to enable ASP.NET applications and XML Web services, both of which are discussed later in this topic.
Internet Explorer is an example of an unmanaged application that hosts the runtime (in the form of a MIME type extension). Using Internet Explorer to host the runtime enables you to embed managed components or Windows Forms controls in HTML documents. Hosting the runtime in this way makes managed mobile code (similar to Microsoft® ActiveX® controls) possible, but with significant improvements that only managed code can offer, such as semi-trusted execution and secure isolated file storage.
The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system. The illustration also shows how managed code operates within a larger architecture.
.NET Framework in context
![Page 2: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/2.jpg)
The following sections describe the main components and features of the .NET Framework in greater detail.
Features of the Common Language Runtime
The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. These features are intrinsic to the managed code that runs on the common language runtime.
With regards to security, managed components are awarded varying degrees of trust, depending on a number of factors that include their origin (such as the Internet, enterprise network, or local computer). This means that a managed component might or might not be able to perform file-access operations, registry-access operations, or other sensitive functions, even if it is being used in the same active application.
The runtime enforces code access security. For example, users can trust that an executable embedded in a Web page can play an animation on screen or sing a song, but cannot access their personal data, file system, or network. The security features of the runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich.
The runtime also enforces code robustness by implementing a strict type-and-code-verification infrastructure called the common type system (CTS). The CTS ensures that all managed code is self-describing. The various Microsoft and third-party language compilers generate managed code that conforms to the CTS. This means that managed code can consume other managed types and instances, while strictly enforcing type fidelity and type safety.
In addition, the managed environment of the runtime eliminates many common software issues. For example, the runtime automatically handles object layout and manages references to objects, releasing
![Page 3: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/3.jpg)
them when they are no longer being used. This automatic memory management resolves the two most common application errors, memory leaks and invalid memory references.
The runtime also accelerates developer productivity. For example, programmers can write applications in their development language of choice, yet take full advantage of the runtime, the class library, and components written in other languages by other developers. Any compiler vendor who chooses to target the runtime can do so. Language compilers that target the .NET Framework make the features of the .NET Framework available to existing code written in that language, greatly easing the migration process for existing applications.
While the runtime is designed for the software of the future, it also supports software of today and yesterday. Interoperability between managed and unmanaged code enables developers to continue to use necessary COM components and DLLs.
The runtime is designed to enhance performance. Although the common language runtime provides many standard runtime services, managed code is never interpreted. A feature called just-in-time (JIT) compiling enables all managed code to run in the native machine language of the system on which it is executing. Meanwhile, the memory manager removes the possibilities of fragmented memory and increases memory locality-of-reference to further increase performance.
Finally, the runtime can be hosted by high-performance, server-side applications, such as Microsoft® SQL Server™ and Internet Information Services (IIS). This infrastructure enables you to use managed code to write your business logic, while still enjoying the superior performance of the industry's best enterprise servers that support runtime hosting.
.NET Framework Class Library
The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented, providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use, but also reduces the time associated with learning new features of the .NET Framework. In addition, third-party components can integrate seamlessly with classes in the .NET Framework.
For example, the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. Your collection classes will blend seamlessly with the classes in the .NET Framework.
As you would expect from an object-oriented class library, the .NET Framework types enable you to accomplish a range of common programming tasks, including tasks such as string management, data collection, database connectivity, and file access. In addition to these common tasks, the class library includes types that support a variety of specialized development scenarios. For example, you can use the .NET Framework to develop the following types of applications and services:
Console applications. Windows GUI applications (Windows Forms). ASP.NET applications. XML Web services. Windows services.
For example, the Windows Forms classes are a comprehensive set of reusable types that vastly simplify Windows GUI development. If you write an ASP.NET Web Form application, you can use the Web Forms classes.
Client Application Development
Client applications are the closest to a traditional style of application in Windows-based programming. These are the types of applications that display windows or forms on the desktop, enabling a user to perform a task. Client applications include applications such as word processors and spreadsheets, as well as custom business applications such as data-entry tools, reporting tools, and so on. Client
![Page 4: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/4.jpg)
applications usually employ windows, menus, buttons, and other GUI elements, and they likely access local resources such as the file system and peripherals such as printers.
Another kind of client application is the traditional ActiveX control (now replaced by the managed Windows Forms control) deployed over the Internet as a Web page. This application is much like other client applications: it is executed natively, has access to local resources, and includes graphical elements.
In the past, developers created such applications using C/C++ in conjunction with the Microsoft Foundation Classes (MFC) or with a rapid application development (RAD) environment such as Microsoft® Visual Basic®. The .NET Framework incorporates aspects of these existing products into a single, consistent development environment that drastically simplifies the development of client applications.
The Windows Forms classes contained in the .NET Framework are designed to be used for GUI development. You can easily create command windows, buttons, menus, toolbars, and other screen elements with the flexibility necessary to accommodate shifting business needs.
For example, the .NET Framework provides simple properties to adjust visual attributes associated with forms. In some cases the underlying operating system does not support changing these attributes directly, and in these cases the .NET Framework automatically recreates the forms. This is one of many ways in which the .NET Framework integrates the developer interface, making coding simpler and more consistent.
Unlike ActiveX controls, Windows Forms controls have semi-trusted access to a user's computer. This means that binary or natively executing code can access some of the resources on the user's system (such as GUI elements and limited file access) without being able to access or compromise other resources. Because of code access security, many applications that once needed to be installed on a user's system can now be safely deployed through the Web. Your applications can implement the features of a local application while being deployed like a Web page.
Server Application Development
Server-side applications in the managed world are implemented through runtime hosts. Unmanaged applications host the common language runtime, which allows your custom managed code to control the behavior of the server. This model provides you with all the features of the common language runtime and class library while gaining the performance and scalability of the host server.
The following illustration shows a basic network schema with managed code running in different server environments. Servers such as IIS and SQL Server can perform standard operations while your application logic executes through the managed code.
Server-side managed code
ASP.NET is the hosting environment that enables developers to use the .NET Framework to target Web-based applications. However, ASP.NET is more than just a runtime host; it is a complete architecture for developing Web sites and Internet-distributed objects using managed code. Both Web Forms and XML Web services use IIS and ASP.NET as the publishing mechanism for applications, and both have a collection of supporting classes in the .NET Framework.
![Page 5: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/5.jpg)
XML Web services, an important evolution in Web-based technology, are distributed, server-side application components similar to common Web sites. However, unlike Web-based applications, XML Web services components have no UI and are not targeted for browsers such as Internet Explorer and Netscape Navigator. Instead, XML Web services consist of reusable software components designed to be consumed by other applications, such as traditional client applications, Web-based applications, or even other XML Web services. As a result, XML Web services technology is rapidly moving application development and deployment into the highly distributed environment of the Internet.
If you have used earlier versions of ASP technology, you will immediately notice the improvements that ASP.NET and Web Forms offer. For example, you can develop Web Forms pages in any language that supports the .NET Framework. In addition, your code no longer needs to share the same file with your HTTP text (although it can continue to do so if you prefer). Web Forms pages execute in native machine language because, like any other managed application, they take full advantage of the runtime. In contrast, unmanaged ASP pages are always scripted and interpreted. ASP.NET pages are faster, more functional, and easier to develop than unmanaged ASP pages because they interact with the runtime like any managed application.
The .NET Framework also provides a collection of classes and tools to aid in development and consumption of XML Web services applications. XML Web services are built on standards such as SOAP (a remote procedure-call protocol), XML (an extensible data format), and WSDL ( the Web Services Description Language). The .NET Framework is built on these standards to promote interoperability with non-Microsoft solutions.
For example, the Web Services Description Language tool included with the .NET Framework SDK can query an XML Web service published on the Web, parse its WSDL description, and produce C# or Visual Basic source code that your application can use to become a client of the XML Web service. The source code can create classes derived from classes in the class library that handle all the underlying communication using SOAP and XML parsing. Although you can use the class library to consume XML Web services directly, the Web Services Description Language tool and the other tools contained in the SDK facilitate your development efforts with the .NET Framework.
If you develop and publish your own XML Web service, the .NET Framework provides a set of classes that conform to all the underlying communication standards, such as SOAP, WSDL, and XML. Using those classes enables you to focus on the logic of your service, without concerning yourself with the communications infrastructure required by distributed software development.
Finally, like Web Forms pages in the managed environment, your XML Web service will run with the speed of native machine language using the scalable communication of IIS.
![Page 6: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/6.jpg)
.NET Framework Developer's Guide
What's New in the .NET Framework Version 2.0
The Microsoft .NET Framework version 2.0 extends the .NET Framework version 1.1 with new features,
improvements to existing features, and enhancements to the documentation. This section provides
information about some key additions and modifications.
For more information about breaking changes that might affect your application, see Breaking Changes in
the .NET Framework.
64-Bit Platform Support
The new generation of 64-bit computers enables the creation of applications that can run faster and take
advantage of more memory than is available to 32-bit applications. New support for 64-bit applications
enables users to build managed code libraries or easily use unmanaged code libraries on 64-bit
computers. For more information, see 64-bit Applications.
Access Control List Support
An access control list (ACL) is used to grant or revoke permission to access a resource on a computer.
New classes have been added to the .NET Framework that allow managed code to create and modify an
ACL. New members that use an ACL have been added to the I/O, registry, and threading classes.
ADO.NET
New features in ADO.NET include support for user-defined types (UDT), asynchronous database
operations, XML data types, large value types, snapshot isolation, and new attributes that allow
applications to support multiple active result sets (MARS) with SQL Server 2005. For more information
about these and other new ADO.NET features, see What's New in ADO.NET.
ASP.NET
The Microsoft .NET Framework 2.0 includes significant enhancements to all areas of ASP.NET. For Web
page development, new controls make it easier to add commonly used functionality to dynamic Web
pages. New data controls make it possible to display and edit data on an ASP.NET Web page without
writing code. An improved code-behind model makes developing ASP.NET pages easier and more
robust. Caching features provide several new ways to cache pages, including the ability to build cache
dependency on tables in a SQL Server database.
You can now customize Web sites and pages in a variety of ways. Profile properties enable ASP.NET to
track property values for individual users automatically. Using Web Parts, you can create pages that
users can customize in the browser. You can add navigation menus using simple controls.
Improvements to Web site features allow you to create professional Web sites faster and more easily.
Master pages allow you to create a consistent layout for all the pages in a site, and themes allow you to
![Page 7: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/7.jpg)
define a consistent look for controls and static text. To help protect your sites, you can precompile a Web
site to produce executable code from source files (both code files and the markup in .aspx pages). You
can then deploy the resulting output, which does not include any source information, to a production
server. Enhancements to ASP.NET also include new tools and classes to make Web site management
easier for Web site developers, server administrators, and hosters.
ASP.NET accommodates a wide variety of browsers and devices. By default, controls render output that
is compatible with XHTML 1.1 standards. You can use device filtering to specify different property values
on the same control for different browsers.
Authenticated Streams
Applications can use the new NegotiateStream and SslStream classes for authentication and to help
secure information transmitted between a client and a server. These authenticated stream classes
support mutual authentication, data encryption, and data signing. The NegotiateStream class uses the
Negotiate security protocol for authentication. The SslStream class uses the Secure Socket Layer (SSL)
security protocol for authentication.
COM Interop Services Enhancements
Four major enhancements have been made to the classes and tools that support interoperability with
COM:
The operating system maintains a limited number of handles, which are used to reference critical
operating system resources. The new SafeHandle and CriticalHandle classes, and their
specialized derived classes, provide safe and reliable means of manipulating operating system
handles.
Marshaling improvements make interoperating with native code easier. Two enhancements to the
interop marshaler satisfy the two most common user requests: the ability to wrap native function
pointers into delegates and the ability to marshal fixed-size arrays of structures inside structures.
The performance of calls between applications in different application domains has been made
much faster for common call types.
New switches on the Type Library Importer (Tlbimp.exe) and Type Library Exporter (Tlbexp.exe)
eliminate dependency on the registry to resolve type library references. This enhancement is
important for creating robust build environments.
Console Class Additions
New members of the Console class enable applications to manipulate the dimensions of the console
window and screen buffer; to move a rectangular area of the screen buffer, which is useful for performing
smooth, simple animation; and to wait while reading console input until a key is pressed. Other new class
members control the foreground and background colors of text, the visibility and size of the cursor, and
the frequency and duration of the console beep.
![Page 8: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/8.jpg)
Data Protection API
The new Data Protection API (DPAPI) includes four methods that allow applications to encrypt
passwords, keys, connections strings, and so on, without calling platform invoke. You can also encrypt
blocks of memory on computers running Windows Server 2003 or later operating systems.
Debugger Display Attributes
You can now control how Visual Studio displays a class or member when an application is being
debugged. The debugger's Display Attributes feature enables you to identify the most useful information
to display in the debugger.
Debugger Edit and Continue Support
The .NET Framework 2.0 reintroduces the Edit and Continue feature that enables a user who is
debugging an application in Visual Studio to make changes to source code while executing in Break
mode. After source code edits are applied, the user can resume code execution and observe the effect.
Furthermore, the Edit and Continue feature is available in any programming language supported by
Visual Studio.
Detecting Changes in Network Connectivity
The NetworkChange class allows applications to receive notification when the Internet Protocol (IP)
address of a network interface, also known as a network card or adapter, changes. An interface address
can change for a variety of reasons, such as a disconnected network cable, moving out of range of a
wireless local area network, or hardware failure. The NetworkChange class provides address change
notification by raising events when a change is detected.
Distributed Computing
In the System.Net namespace, support has been added for FTP client requests, caching of HTTP
resources, automatic proxy discovery, and obtaining network traffic and statistical information. The
namespace now includes a Web server class (HttpListener) that you can use to create a simple Web
server for responding to HTTP requests. Classes that generate network traffic have been instrumented to
output trace information for application debugging and diagnostics. Security and performance
enhancements have been added to the System.Net.Sockets.Socket and System.Uri classes.
In the System.Web.Services namespaces, support for SOAP 1.2 and nullable elements has been
added.
In the System.Runtime.Remoting.Channels namespaces, channel security features have been added.
The TCP channel now supports authentication and encryption, as well as several new features to better
support load balancing.
EventLog Enhancements
![Page 9: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/9.jpg)
You can now use custom DLLs for EventLog messages, parameters, and categories.
Expanded Certificate Management
The .NET Framework now supports X.509 certificate stores, chains, and extensions. In addition, you can
sign and verify XML using X.509 certificates without using platform invoke. There is also support for
PKCS7 signature and encryption, and CMS (a superset of the PKCS7 standard available on Microsoft
Windows 2000 and later operating systems). PKCS7 is the underlying format used in
Secure/Multipurpose Internet Mail Extensions (S/MIME) for signing and encrypting data. For more
information, see the X509Certificate2 class topic.
FTP Support
Applications can now access File Transfer Protocol resources using the WebRequest, WebResponse,
and WebClient classes.
Generics and Generic Collections
The .NET Framework 2.0 introduces generics to allow you to create flexible, reusable code. Language
features collectively known as generics act as templates that allow classes, structures, interfaces,
methods, and delegates to be declared and defined with unspecified, or generic type parameters instead
of specific types. Actual types are specified later when the generic is used. Several namespaces, such as
System Namespace and System.Collections.Generic, provide generic classes and methods. The new
System.Collections.Generic namespace provides support for strongly typed collections. Generics are
supported in three languages: Visual Basic, C#, and C++.
Reflection has been extended to allow runtime examination and manipulation of generic types and
methods. New members have been added to System.Type and System.Reflection.MethodInfo,
including IsGenericType to identify generic types (for example, class Gen<T,U> {...}),
GetGenericArguments to obtain type parameter lists, and MakeGenericType to create specific types (for
example, new Gen<int, long>()).
Globalization
Five new globalization features provide greater support for developing applications intended for different
languages and cultures.
Support for custom cultures enables you to define and deploy culture-related information as
needed. This feature is useful for creating minor customizations of existing culture definitions, and
creating culture definitions that do not yet exist in the .NET Framework. For more information, see
the CultureAndRegionInfoBuilder class.
Encoding and decoding operations map a Unicode character to or from a stream of bytes that can
be transferred to a physical medium such as a disk or a communication line. If a mapping
operation cannot be completed, you can compensate by using the new encoding and decoding
fallback feature supported by several classes in the System.Text namespace.
![Page 10: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/10.jpg)
Members in the UTF8Encoding class, which implements UTF-8 encoding, are now several times
faster than in previous releases. UTF-8 is the most common encoding used to transform Unicode
characters into bytes on computers.
The .NET Framework now supports the latest normalization standard defined by the Unicode
Consortium. The normalization process converts character representations of text to a standard
form so the representations can be compared for equivalence.
The GetCultureInfo method overload provides a cached version of a read-only CultureInfo object.
Use the cached version when creating a new CultureInfo object to improve system performance
and reduce memory usage.
I/O Enhancements
Improvements have been made to the usability and functionality of various I/O classes. It is now easier for
users to read and write text files and obtain information about a drive.
You can now use the classes in the System.IO.Compression namespace to read and write data with the
GZIP compression and decompression standard, described in the IETF RFC 1951 and RFC 1952
specifications, which are available at the IETF Request for Comments (RFC) search page. Note: search
is limited to RFC numbers.
Manifest-Based Activation
This feature provides new support for loading and activating applications through the use of a manifest.
Manifest-based activation is essential for supporting ClickOnce applications. Traditionally, applications
are activated through a reference to an assembly that contains the application's entry point. For example,
clicking an application's .exe file from within the Windows shell causes the shell to load the common
language runtime (CLR) and call a well-known entry point within that .exe file's assembly.
The manifest-based activation model uses an application manifest for activation rather than an assembly.
A manifest fully describes the application, its dependencies, security requirements, and so forth. The
manifest model has several advantages over the assembly-based activation model, especially for Web
applications. For example, the manifest contains the security requirements of the application, which
enables the user to decide whether to allow the application to execute before downloading the code. The
manifest also contains information about the application dependencies.
Manifest-based activation is provided by a set of APIs that allow managed hosts to activate applications
and add-ins described by a manifest. These APIs contain a mixture of both new classes and extensions
to existing classes.
This activation model also invokes an entity called a Trust Manager that performs the following tasks:
1. Determines whether an application is allowed to be activated. This decision can be made by
prompting the user, querying policy, or by any other means deemed appropriate for a given Trust
Manager.
![Page 11: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/11.jpg)
2. Sets up the security context to run an application in. Most commonly, this step involves setting up
a code access security (CAS) policy tree on the application domain in which the application will run.
.NET Framework Remoting
.NET Framework remoting now supports IPv6 addresses and the exchange of generic types. The classes
in the System.Runtime.Remoting.Channels.Tcp namespace support authentication and encryption using
the Security Support Provider Interface (SSPI). Classes in the new
System.Runtime.Remoting.Channels.Ipc namespace allow applications on the same computer to
communicate quickly without using the network. Finally, you can now configure the connection cache
time-out and the number of method retries, which can improve the performance of network load-balanced
remote clusters.
Obtaining Information About Local Computer Network Configuration and Usage
Using classes in the System.Net.NetworkInformation namespace, applications can access IP, IPv4, IPv6,
TCP, and UDP network traffic statistics. Applications can also view address and configuration information
for the local computer’s network adapters. This information is similar to the information returned by the
Ipconfig.exe command-line tool.
Ping
The Ping class allows an application to determine whether a remote computer is accessible over the
network. This class provides functionality similar to the Ping.exe command-line tool, and supports
synchronous and asynchronous calls.
Processing HTTP Requests from Within Applications
You can use the HttpListener class to create a simple Web server that responds to HTTP requests. The
Web server is active for the lifetime of the HttpListener object and runs within your application, with your
application's permissions. This class is available only on computers running the Windows XP Service
Pack 2 or Windows Server 2003 operating systems.
Programmatic Control of Caching
Using the classes in the System.Net.Cache namespace, applications can control the caching of resources
obtained using the WebRequest, WebResponse, and WebClient classes. You can use the predefined
cache policies provided by the .NET Framework or specify a custom cache policy. You can specify a
cache policy for each request and define a default cache policy for requests that do not specify a cache
policy.
Programming Languages
Four Microsoft programming languages explicitly target the .NET Framework: Visual C#, Microsoft C/C++,
Visual J#, and Visual Basic.
![Page 12: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/12.jpg)
Visual Basic Compiler and Language
Language improvements in Visual Basic simplify source code and enable interaction with components
that use advanced features.
Compiler
Visual Basic introduces a new conditional compilation constant, VBC_VER, for all projects. This version
has the value of VBC_VER 8.0.
The Visual Basic command-line compiler now stores the default command-line options in the Vbc.rsp file,
in the same directory as the command-line compiler (Vbc.exe). You can edit Vbc.rsp to reconfigure the
default command-line options.
There are four new command-line compiler options:
The /doc option generates an XML documentation file based on comments within your code.
The /noconfig option causes the compiler to ignore the Vbc.rsp file.
The /codepage option specifies which codepage to use when opening source files.
The /filealign option specifies the size of sections in your output file.
The /nostdlib (Visual Basic) option causes the compiler not to reference the standard libraries.
For more information, see Visual Basic Compiler Options.
Language
There are several new elements in this version of the Visual Basic language:
Continue Statement
Operator Statement
Using Statement
IsFalse Operator
IsNot Operator
IsTrue Operator
SByte Data Type
UInteger Data Type
ULong Data Type
UShort Data Type
Global
![Page 13: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/13.jpg)
Of
Narrowing
Widening
Partial (Visual Basic)
Custom
Security Exceptions
The System.Security . . :: . SecurityException class has been expanded to provide additional data that
facilitates investigation into the cause of security exceptions. New properties provide information that
includes the method in which the exception occurred, the first permission that failed, the zone or URL of
the assembly, the security action that failed, and the security action on the call stack, such as Deny or
PermitOnly, that caused the exception.
Serial I/O Device Support
The new SerialPort class provides applications with the ability to access the serial ports on a computer
and to communicate with serial I/O devices.
Serialization
The BinaryFormatter and SoapFormatter classes now support version-tolerant serialization, which allows
a type to be deserialized from the serialization of a different version. For more details, see Version
Tolerant Serialization.
XML serialization now supports the use of properties instead of fields to represent schema elements, the
serialization of generic types, and the use of the Nullable < (Of < ( T > ) > ) structure to represent nullable
elements. The IXmlSerializable interface supports custom schema generation. The
SchemaImporterExtension allows you to control proxy code generation by altering schemas during
schema importation. For example, you can alter the proxy generated when using the Add Web Reference
feature of Visual Studio, or when using the Web Services Description Language Tool (Wsdl.exe).
The new XML Serializer Generator Tool (Sgen.exe) allows you to precompile the code used by Web
services clients to serialize transmitted information, which greatly improves the client startup time. For
more details, see Introducing XML Serialization.
SMTP Support
Using the classes in the System.Net.Mail and System.Net.Mime namespaces, applications can send e-
mail to one or more recipients. Mail can be sent with alternate views and can include attachments.
Sending carbon copies and blind carbon copies is also supported.
Strongly Typed Resource Support
![Page 14: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/14.jpg)
The Resource File Generator (Resgen.exe) creates resource files that are embedded in executable files
and satellite assemblies. Resgen.exe produces a wrapper class for each resource file, which gives you
easy access to resources and prevents spelling mistakes in resource names.
Threading Improvements
You can now name cross-process communication events that are created purely in managed code. The
Semaphore class also supports specialized resource counting.
Trace Data Filtering
The .NET Framework 2.0 provides classes that trace and log system events related to I/O, application
startup and shutdown, and so on. However, the enormous volume and diverse types of trace information
make it difficult for users to analyze this data. New support for trace data filtering enables you to specify
the type of information to log.
Transactions
The new System.Transactions namespace contains classes that allow your applications to participate in
transactions managed by the Microsoft Distributed Transaction Coordinator (MSDTC) or the local
transaction manager. The System.Transactions namespace provides both an explicit programming model
based on the Transaction class, and an implicit programming model using the TransactionScope class, in
which transactions are automatically managed by the infrastructure. This transaction infrastructure can
easily interoperate with the existing System.EnterpriseServices (COM+) transaction infrastructure. The
System.Transactions namespace also provides classes for implementing a resource manager. A
resource manager manages durable or volatile data used in a transaction, and works in cooperation with
the transaction manager to provide the application with a guarantee of atomicity and isolation.
Web Services
Web services support SOAP 1.2 and the WS-I Basic Profile 1.0, which is documented at "Web Services
Interoperability Organization - Basic Profile Version 1.0".
When consuming two or more Web services that define a shared type, the client proxies generated for
those Web services share the corresponding type on the client. This allows clients to easily pass
instances of shared types among Web services.
You can now invoke Web methods asynchronously using an event-based programming pattern.
Windows Forms–Related Features
ClickOnce Deployment
ClickOnce deployment allows you to deploy self-updating Windows applications that can be installed and
run as easily as Web applications. You can deploy Windows client and command-line applications. There
![Page 15: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/15.jpg)
are new Publish Project commands on the Build and Project menus in Visual Studio. For more
information, see ClickOnce Deployment Overview.
Application Settings
Application settings for Windows Forms make it easy to create, store, and maintain custom application
and user preferences on the client. With Windows Forms settings, you can store not only application data,
such as database connection strings, but also user-specific data, such as toolbar positions and most-
recently-used lists. For more information, see Application Settings Overview.
New Data-Binding Model
The BindingSource component simplifies the process of data binding because it acts as an intermediary
between the bound control and the target data source. It automatically manages many of the more difficult
binding issues such as currency, data-related events, and target data source changes. It is also designed
to interoperate with other data-related Windows Forms controls, particularly the BindingNavigator and the
DataGridView controls. For more information, see BindingSource Component. The BindingSource
component simplifies the process of binding controls to an underlying data source. It acts as both a
conduit and a data source to which other controls bind.
New Windows Forms Controls
The DataGridView control provides a powerful and flexible way to display data in a tabular format. It can
be used to show read-only views of a small amount of data or it can be scaled to show editable views of
very large sets of data. The data can reside in an external data source or be added directly to the control.
For more information, see DataGridView Control Overview (Windows Forms).
ToolStrip controls are toolbars that can host menus, controls, and user controls in your Windows Forms
applications. The ToolStrip class and its associated classes enable you to create toolbars and other user
interface elements in a style that is consistent with Microsoft Windows XP, Microsoft Office, and Microsoft
Internet Explorer. You can also use these classes to customize toolbars and user interface elements. For
more information, see ToolStrip Control Overview (Windows Forms).
The MaskedTextBox control uses a mask definition to distinguish between valid and invalid user input.
For more information, see MaskedTextBox Control (Windows Forms).
The Windows Forms SoundPlayer class enables you to easily include sounds in your applications. The
SoundPlayer class can play sound files in the .wav format, either from a resource or from Universal
Naming Conventions (UNC) or HTTP locations. Additionally, the SoundPlayer class enables you to load
or play sounds asynchronously. For more information, see SoundPlayer Class.
The Windows Forms SplitContainer control can be thought of as a composite; it is two panels separated
by a movable bar. When the mouse pointer hovers over the bar, the cursor changes to show that the bar
is movable. Use this control to create complex, resizable user interfaces that are effective for displaying
and browsing information. For more information, see SplitContainer Control.
![Page 16: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/16.jpg)
The ListView control now supports three features provided by Windows XP and the Windows Server 2003
family: tile view, grouping, and drag-and-drop item repositioning.
The ListView, TreeView, and ToolTip controls now support owner drawing functionality similar to the
owner drawing support for the ComboBox, ListBox, MenuItem, and TabControl controls in the previous
release.
The WebBrowser control lets you host Web pages in your Windows Forms applications. You can use the
WebBrowser control to provide integrated HTML-based Help or Internet Web browsing capabilities in your
application. Additionally, you can use the WebBrowser control to convert existing Web applications to
client applications that seamlessly integrate dynamic HTML (DHTML) code with the user interface
capabilities of Windows Forms. For more information, see WebBrowser Control Overview.
The FlowLayoutPanel control arranges its contents in a horizontal or vertical flow direction. The
TableLayoutPanel control arranges its contents in a grid. Because the layout is performed both at design
time and run time, it can change dynamically as the application environment changes. For more
information, see FlowLayoutPanel Control Overview and TableLayoutPanel Control Overview.
The BackgroundWorker component enables you to perform operations in the background that can take a
long time to execute, such as image downloads and database transactions. For more information, see
BackgroundWorker Component Overview.
The Asynchronous Pattern for Components is an event-driven model that provides the advantages of
multithreaded applications while hiding many of the complex issues inherent in multithreaded design. For
more information, see Asynchronous Pattern for Components.
XML-Related Features
The .NET Framework 2.0 provides many enhancements, including a new XSL Transformation (XSLT)
processor; type support in the XmlReader, XmlWriter, and XPathNavigator classes; and new editing
capabilities in the XPathNavigator class. In addition, there is a new model for creating XmlReader and
XmlWriter objects, and many performance improvements. For more information, see What's New in
System.Xml.
![Page 17: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/17.jpg)
NET Framework Developer's Guide
What's New in the .NET Framework Version 3.5
This topic contains information about new and enhanced features in the .NET Framework version 3.5.
.NET Compact Framework
The .NET Compact Framework version 3.5 expands support for distributed mobile applications by
including the Windows Communication Foundation (WCF) technology. It also adds new language
features such as LINQ, new APIs based on community feedback, and improves debugging with updated
diagnostic tools and features.
For details about these new features and enhancements, see What's New in the .NET Compact
Framework Version 3.5
ASP.NET
The .NET Framework 3.5 includes enhancements in targeted areas of ASP.NET and Visual Web
Developer. The most significant advance is improved support for the development of AJAX-enabled Web
sites. ASP.NET supports server-centric AJAX development with a set of new server controls and APIs.
You can enable an existing ASP.NET 2.0 page for AJAX by adding a ScriptManager control and
an UpdatePanel control so that the page can update without requiring a full page refresh.
ASP.NET also supports client-centric AJAX development with a new client library called the Microsoft
AJAX Library. The Microsoft AJAX Library supports client-centric, object-oriented development, which is
browser-independent. By using the library classes in your ECMAScript (JavaScript) you can enable rich
UI behaviors without roundtrips to the server. You can mix the degree of server-centric and client-centric
development to meet the needs of your application. Furthermore, Visual Web Developer includes
improved IntelliSense support for JavaScript and support for the Microsoft AJAX Library.
ASP.NET and Visual Web Developer now support the creation of both ASMX and WCF-based Web
services and the seamless use of either implementation from Web pages using Microsoft AJAX Library.
Furthermore, server-side application services including forms authentication, roles management, and
profiles are now exposed as Web services that can be consumed in WCF-compatible applications,
including client script and Window Forms clients. ASP.NET enables all Web-based applications to share
these common application services.
Other improvements in ASP.NET include a new data control, ListView, for displaying data; a new data
source control, LinqDataSource, that exposes Language Integrated Query (LINQ) to Web developers
through the ASP.NET data source control architectures; a new tool, ASP.NET Merge Tool
(Aspnet_merge.exe), for merging precompiled assemblies; and tight integration with IIS 7.0. ListView is a
highly customizable control (using templates and styles) that also supports edit, insert, and delete
operations, as well as sorting and paging functionality. The paging functionality for ListView is provided by
![Page 18: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/18.jpg)
a new control called DataPager. You can use the merge tool to combine assemblies to support a range of
deployment and release management scenarios. The integration of ASP.NET and IIS 7.0 includes the
ability to use ASP.NET services, such as authentication and caching, for any content type. It also includes
the ability to develop server pipeline modules in ASP.NET managed code and supports unified
configuration of modules and handlers.
Other improvements in Visual Web Developer include multitargeting support, inclusion of Web Application
Projects, a new Design view, new Cascading Style Sheets (CSS) design tools, and support for LINQ for
SQL databases. Multitargeting enables you to use Visual Web Developer to target development of Web
applications to specific versions of the .NET Framework, including versions 2.0, 3.0, and 3.5.
For more information, see What's New in ASP.NET and Web Development.
Add-Ins and Extensibility
The System.AddIn.dll assembly in the .NET Framework 3.5 provides powerful and flexible support to
developers of extensible applications. It introduces a new architecture and model that helps developers
with the initial work to add extensibility to an application and by ensuring that their extensions continue
working as the host application changes. The model provides the following features:
Discovery
You can easily find and manage sets of add-ins in multiple locations on a computer with the
AddInStore class. You can use this class to search for and obtain information about add-ins by
their base types without having to load them.
Activation
After an application chooses an add-in, the AddInToken class makes it easy to activate. Simply
choose the isolation and sandboxing level and the system takes care of the rest.
Isolation
There is built-in support for application domains and process isolation of add-ins. The isolation
level for each add-in is in the control of the host. The system handles loading application domains
and processes and shutting them down after their add-ins have stopped running.
Sandboxing
You can easily configure add-ins with either a default or customized trust level. Support includes
Internet, Intranet, Full Trust, and “same-as-host” permission sets, as well as overloads that let the
host specify a custom permission set.
UI Composition
![Page 19: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/19.jpg)
The add-in model supports direct composition of Windows Presentation Foundation (WPF)
controls that span application domain boundaries. You can easily allow add-ins to contribute
directly to the UI of the host while still retaining the benefits of isolation, ability to unload,
sandboxing, and versioning.
Versioning
The add-in architecture makes it possible for hosts to introduce new versions of their object
model without breaking existing add-ins or impacting the developer experience for new ones.
For more information, see Add-ins and Extensibility.
Common Language Runtime
Collections
HashSet < (Of < ( T > ) > ) provides high performance set operations to the .NET Framework. A set is a
collection that contains no duplicate elements, and whose elements are in no particular order. For more
information, see HashSet Collection Type.
Diagnostics
The EventSchemaTraceListener class provides tracing of end-to-end, schema-compliant events. You can
use end-to-end tracing for a system that has heterogeneous components that cross thread, AppDomain,
process, and computer boundaries. A standardized event schema (see Event Representation for Event
Consumers) has been defined to enable tracing across these boundaries. This schema is shared by
various tracing technologies, including Windows Vista diagnostics tools such as Event Viewer. The
schema also enables the addition of custom, schema-compliant elements.
The EventSchemaTraceListener class is tuned for logging performance with implicit support for lock-free
tracing.
I/O and Pipes
Pipes provide interprocess communication between any processes running on the same computer, or on
any other Windows computer within a network. The .NET Framework provides access to two types of
pipes: anonymous pipes and named pipes. For more information about pipes, see Pipes.
Garbage Collection
The GCSettings class has a new LatencyMode property that you can use to adjust the time that the
garbage collector intrudes in your application. You set this property to one of the values of the new
GCLatencyMode enumeration.
The GC class has a new Collect(Int32, GCCollectionMode) method overload that you can use to adjust
the behavior for a forced garbage collection. For example, you can use this overload to specify that the
![Page 20: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/20.jpg)
garbage collector should determine whether the current time is optimal to reclaim objects. This overload
takes a value from the new GCCollectionMode enumeration.
Reflection and Reflection Emit in Partial Trust
Assemblies that run with partial trust can now emit code and execute it. Emitted code that calls only public
types and methods needs no permissions beyond the permissions demanded by the types and methods
that are accessed. The new DynamicMethod(String, Type, array< Type > [] () [] ) constructor makes it easy to
emit such code.
When emitted code needs to access private data, the new DynamicMethod(String, Type, array< Type > [] ()
[] , Boolean) constructor allows restricted access. The host must grant ReflectionPermission with the new
RestrictedMemberAccess flag to enable this feature, which gives emitted code the ability to access
private data only for types and methods in assemblies with equal or lesser trust levels. See Walkthrough:
Emitting Code in Partial Trust Scenarios.
For reflection, a host grant of RestrictedMemberAccess similarly allows restricted use of methods that
access private properties, call private methods, and so on, but only for target assemblies with equal or
lesser trust levels.
ThreadingBetter Reader/Writer Lock
The new ReaderWriterLockSlim class provides performance that is significantly better than
ReaderWriterLock, and comparable with the lock statement (SyncLock in Visual Basic). Transitions
between lock states have been simplified to make programming easier and to reduce the chances of
deadlocks. The new class supports recursion to simplify migration from lock and from ReaderWriterLock.
ThreadPool Performance Enhancements
Throughput for the dispatch of work items and I/O tasks in the managed thread pool is significantly
improved. Dispatch is now handled in managed code, without transitions to unmanaged code and with
fewer locks. The use of ThreadPool is recommended over application-specific thread pool
implementations.
Time Zone Improvements
Two new types, DateTimeOffset and TimeZoneInfo, improve support for time zones and make it easier to
develop applications that work with dates and times in different time zones. For a discussion of which type
to use in particular situations, see Choosing Between DateTime, DateTimeOffset, and TimeZoneInfo.
TimeZoneInfo
The new TimeZoneInfo class largely supplants the existing TimeZone class. You can use TimeZoneInfo
to retrieve any time zone defined in the registry, rather than just the local time zone and Coordinated
Universal Time (UTC). You can also use this class to define custom time zones, to serialize and
![Page 21: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/21.jpg)
deserialize custom time zone data, and to convert times between time zones. For more information about
developing applications that use the TimeZoneInfo class, see Times and Time Zones.
DateTimeOffset
The new DateTimeOffset structure extends the DateTime structure to make working with times across
time zones easier. The DateTimeOffset structure stores date and time information as a UTC date and
time together with an offset value that indicates how much the time differs from UTC.
Cryptography
ClickOnce Manifests
There are new cryptography classes for verifying and obtaining information about manifest signatures for
ClickOnce applications. The ManifestSignatureInformation class obtains information about a manifest
signature when you use its VerifySignature method overloads. You can use the ManifestKinds
enumeration to specify which manifests to verify. The result of the verification is one of the
SignatureVerificationResult enumeration values. The ManifestSignatureInformationCollection provides a
read-only collection of ManifestSignatureInformation objects of the verified signatures. In addition, the
following classes provide specific signature information:
StrongNameSignatureInformation
Holds the strong name signature information for a manifest.
AuthenticodeSignatureInformation
Represents the Authenticode signature information for a manifest.
TimestampInformation
Contains information about the time stamp on an Authenticode signature.
TrustStatus
Provides a simple way to check whether an Authenticode signature is trusted.
Suite B Support
The .NET Framework 3.5 supports the Suite B set of cryptographic algorithms published by the National
Security Agency (NSA). For the NSA documentation, see www.nsa.gov/ia/industry/crypto_suite_b.cfm.
The following algorithms are included:
Advanced Encryption Standard (AES) with key sizes of 128 and 256 bits for encryption.
Secure Hash Algorithm (SHA-256 and SHA-384) for hashing.
![Page 22: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/22.jpg)
Elliptic Curve Digital Signature Algorithm (ECDSA) using curves of 256-bit and 384-bit prime
moduli for signing. This algorithm is provided by the ECDsaCng class. It allows you to sign with a
private key and verify with a public key.
Elliptic Curve Diffie-Hellman (ECDH) using curves of 256 and 384-bit prime moduli for key
exchange/secret agreement. This algorithm is provided by the ECDiffieHellmanCng class.
Managed code wrappers for the Federal Information Processing Standard (FIPS) certified
implementations of the AES, SHA-256, and SHA-384 implementations are available in the new
AesCryptoServiceProvider, SHA256CryptoServiceProvider, and SHA384CryptoServiceProvider classes.
The Cryptography Next Generation (CNG) classes provide a managed implementation of the native
Crypto API (CAPI). Central to this group is the CngKey key container class, which abstracts the storage
and use of CNG keys. This class allows you to store a key pair or a public key securely and refer to it
using a simple string name. The ECDsaCng and ECDiffieHellmanCng classes use CngKey objects.
The CngKey class is used for a variety of additional operations, including opening, creating, deleting, and
exporting keys. It also provides access to the underlying key handle to use when calling native APIs
directly.
There are a variety of supporting CNG classes, such as CngProvider, which maintains a key storage
provider, CngAlgorithm, which maintains a CNG algorithm, and CngProperty, which maintains commonly
used key properties.
Networking
Peer-to-Peer Networking
Peer-to-peer networking is a serverless networking technology that allows several network devices to
share resources and communicate directly with each other. The System.Net.PeerToPeer namespace
provides a set of classes that support the Peer Name Resolution Protocol (PNRP) that allows the
discovery of other peer nodes through PeerName objects registered within a peer-to-peer cloud. PNRP
can resolve peer names to IPv6 or IPv4 IP addresses.
Collaboration Using Peer-to-Peer Networking
The System.Net.PeerToPeer.Collaboration namespace provides a set of classes that support
collaboration using the Peer-to-Peer networking infrastructure. These classes simplify the process by
which applications can:
Track peer presence without a server.
Send invitations to participants.
Discover peers on the same subnet or LAN.
Manage contacts.
Interact with peers.
![Page 23: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/23.jpg)
Microsoft’s Peer-to-Peer collaboration infrastructure provides a peer-to-peer network-based framework for
collaborative serverless activities. Use of this framework enables decentralized networking applications
that use the collective power of computers over a subnet or the Internet. These types of applications can
be used for activities such as collaborative planning, communication, content distribution, or even
multiplayer game matchmaking.
Socket Performance Enhancements
The Socket class has been enhanced for use by applications that use asynchronous network I/O to
achieve the highest performance. A series of new classes have been added as part of a set of
enhancements to the Socket namespace. These classes provide an alternative asynchronous pattern that
can be used by specialized high-performance socket applications. These enhancements were specifically
designed for network server applications that require the high-performance.
Windows Communication Foundation
WCF and WF Integration—Workflow Services
The .NET Framework 3.5 unifies the Windows Workflow Foundation (WF) and Windows Communication
Foundation (WCF) frameworks so that you can use WF as a way to author WCF services or expose your
existing WF workflow as a service. This enables you to create services that can be persisted, can easily
transfer data in and out of a workflow, and can enforce application-level protocols. For more information,
see Creating Workflow Services and Durable Services. For code samples, see Workflow Services
Samples.
Durable Services
The .NET Framework 3.5 also introduces support for WCF services that use the WF persistence model to
persist the state information of the service. These durable services persist their state information on the
application layer, so that if a session is torn down and re-created later, the state information for that
service can be reloaded from the persistence store. For more information, see Creating Workflow
Services and Durable Services. For a code sample, see Durable Service Sample.
WCF Web Programming Model
The WCF Web Programming Model enables developers to build Web-style services with WCF. The Web
Programming Model includes rich URI processing capability, support for all HTTP verbs including GET,
and a simple programming model for working with a wide variety of message formats (including XML,
JSON, and opaque binary streams). For more information, see Web Programming Model. For code
samples, see Web Programming Model Samples.
WCF Syndication
WCF now includes a strongly typed object model for processing syndication feeds, including both the
Atom 1.0 and RSS 2.0 formats. For more information, see WCF Syndication. For code samples, see
Syndication Samples.
![Page 24: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/24.jpg)
WCF and Partial Trust
In .NET Framework 3.5, applications running with reduced permissions can use a limited subset of WCF
features. Server applications running with ASP.NET Medium Trust permissions can use the WCF Service
Model to create basic HTTP services. Client applications running with Internet Zone permissions (such as
XAML Browser Applications or unsigned applications deployed with ClickOnce) can use the WCF proxies
to consume HTTP services. In addition, the WCF Web Programming Model features (including AJAX and
Syndication) are available for use by partially trusted applications. For more information, see Partial Trust.
For code samples, see Partial Trust WCF Samples.
WCF and ASP.NET AJAX Integration
The integration of WCF with the Asynchronous JavaScript and XML (AJAX) capabilities in ASP.NET
provides an end-to-end programming model for building Web applications that can use WCF services. In
AJAX-style Web applications, the client (for example, the browser in a Web application) exchanges small
amounts of data with the server by using asynchronous requests. Integration with AJAX features in
ASP.NET provides an easy way to build WCF Web services that are accessible by using client JavaScript
in the browser. For more information, see AJAX Integration and JSON Support. For code samples, see
AJAX Samples.
Web Services Interoperability
In the .NET Framework 3.5, Microsoft maintains its commitment to interoperability and public standards
and introduces support for the new secure, reliable, and transacted Web services standards:
Web Services Reliable Messaging v1.1
Web Services Reliable Messaging Policy Assertion v1.1
WS-SecureConversation v1.3
WS-Trust v1.3
WS-SecurityPolicy v1.2
Web Services Atomic Transaction (WS-AtomicTransaction) Version 1.1
Web Services Coordination (WS-Coordination) Version 1.1
Web Services Policy 1.5 - Framework
Web Services Policy 1.5 - Attachment
Implementation of these protocols is made available using the new standard bindings,
<ws2007HttpBinding> and <ws2007FederationHttpBinding>, which are documented in the Web Services
Protocols Interoperability Guide. For a code sample, see WS Binding Samples.
Windows Presentation Foundation
![Page 25: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/25.jpg)
In the .NET Framework 3.5, Windows Presentation Foundation contains changes and improvements in
numerous areas, including versioning, the application model, data binding, controls, documents,
annotations, and 3-D UI elements.
For details about these new features and enhancements, see What's New in Windows Presentation
Foundation Version 3.5.
Windows Workflow Foundation
WCF and WF Integration—Workflow Services
The .NET Framework 3.5 unifies the Windows Workflow Foundation (WF) and Windows Communication
Foundation (WF) frameworks so that you can use WF as a way to author WCF services or expose your
existing WF workflow as a service. This enables you to create services that can be persisted, can easily
transfer data in and out of a workflow, and can enforce application-level protocols. For more information,
see Creating Workflow Services and Durable Services. For code samples, see Workflow Services
Samples (WF).
Rules
The WF rules engine now supports extension methods, operator overloading, and the use of the new
operator in your rules. For more information, see Rule Changes in .NET Framework 3.5. For code
samples, see Rules and Conditions Samples.
Windows Forms
ClickOnce Improvements
Several improvements have been made to ClickOnce. Improvements include deployment from multiple
locations and third-party branding. For more information, see Deploying ClickOnce Applications without
Resigning and Creating ClickOnce Applications for Others to Deploy.
The Mage.exe tool, which is sometimes used together with ClickOnce, has been updated for the .NET
Framework 3.5. For more information, see Manifest Generation and Editing Tool (Mage.exe).
Authentication, Roles, and Settings Services
Client application services are new in the .NET Framework 3.5 and enable Windows-based applications
(including Windows Forms and Windows Presentation Foundation applications) to easily access the
ASP.NET login, roles, and profile services. These services enable you to authenticate users and retrieve
user roles and application settings from a shared server.
You can enable client application services by specifying and configuring client service providers in your
application configuration file or in the Visual Studio Project Designer. These providers plug into the Web
extensibility model and enable you to access the Web services through existing .NET Framework login,
roles, and settings APIs. Client application services also support occasional connectivity by storing and
retrieving user information from a local data cache when the application is offline.
![Page 26: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/26.jpg)
For more information, see Client Application Services.
Windows Vista Support
Existing Windows Forms applications work seamlessly on Windows Vista, and they are upgraded to have
the same appearance as applications written specifically for Windows Vista whenever possible. Common
file dialog boxes are automatically updated to the Windows Vista version. The .NET Framework 3.5 also
supports the User Account Control (UAC) Shield icon. For more information, see FileDialog Class and
Shield.
WPF support
You can use Windows Forms to host Windows Presentation Foundation (WPF) controls and content
together with Windows Forms controls. You can also open WPF windows from a Windows Form. For
more information about how to use Windows Forms and WPF together, see Migration and
Interoperability.
LINQ
Language-Integrated Query (LINQ) is a new feature in Visual Studio 2008 and the .NET Framework
3.5. LINQ extends powerful query capabilities to the language syntax of C# and Visual Basic in the form
of standard, easily-learned query patterns. This technology can be extended to support potentially any
kind of data store. The .NET Framework 3.5 includes LINQ provider assemblies that enable the use of
LINQ for querying .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML
documents.
The components of LINQ that are part of the .NET Framework 3.5 are:
The System.Linq namespace, which contains the set of standard query operators and types and
interfaces that are used in the infrastructure of a LINQ query. This namespace is in the
System.Core.dll assembly.
The System.Data.Linq namespace, which contains classes that support interaction with relational
databases in LINQ to SQL applications.
The System.Data.Linq.Mapping namespace, which contains classes that can be used to generate
a LINQ to SQL object model that represents the structure and content of a relational database.
The System.Xml.Linq namespace, which contains the classes for LINQ to XML. LINQ to XML is
an in-memory XML programming interface that enables you to modify XML documents efficiently
and easily. Using LINQ to XML, you can load XML, serialize XML, create XML trees from scratch,
manipulate in-memory XML trees, and validate by using XSD. You can also use a combination of
these features to transform XML trees from one shape into another.
New types in the System.Web.UI.WebControls and System.Web.UI.Design.WebControls
namespaces. These new types, such as LinqDataSource, support the use of LINQ in ASP.NET
Web pages through a data source control.
![Page 27: The - dotnetspider.com€¦ · Web viewThe .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution](https://reader034.fdocuments.in/reader034/viewer/2022042319/5f0822c47e708231d4208420/html5/thumbnails/27.jpg)
The DataRowComparer, DataRowExtensions, and DataTableExtensions classes in the
System.Data namespace support LINQ queries against ADO.NET DataSet objects.
In the class library, the LINQ extension methods that apply to a class are listed in the members page for
the class, in the Contents pane, and in the Index pane.
Expression Trees
Expression trees are new in the .NET Framework 3.5, and provide a way to represent language-level
code in the form of data. The System.Linq.Expressions namespace contains the types that are the
building blocks of expression trees. These types can be used to represent different types of code
expressions, for example a method call or an equality comparison.
Expression trees are used extensively in LINQ queries that target remote data sources such as a SQL
database. These queries are represented as expression trees, and this representation enables query
providers to examine them and translate them into a domain-specific query language.
The System.Linq.Expressions namespace is in the System.Core.dll assembly.
Programming Languages
Three Microsoft programming languages explicitly target the .NET Framework. For more information
about new and enhanced features in these languages, see the following topics:
What's New in Visual C#
What's New in Visual C++ 2008
What's New in the Visual Basic Language
http://msdn.microsoft.com/en-us/library/t357fb32.aspxhttp://msdn.microsoft.com/en-us/library/a4t23ktk.aspx