Professional Documents
Culture Documents
.NET Framework 2.0 Released with Visual Studio 2005, Microsoft SQL Server 2005, and BizTalk 2006. The 2.0 Redistributable Package can be downloaded for free from Microsoft, and was published on 22 January 2006. The 2.0 Software Development Kit (SDK) can be downloaded for free from Microsoft. It is included as part of Visual Studio 2005 and Microsoft SQL Server 2005. Version 2.0 without any Service Pack is the last version with support for Windows 98 and Windows Me. Version 2.0 with Service Pack 2 is the last version with official support for Windows 2000 although there have been some unofficial workarounds published online to use a subset of the functionality from Version 3.5 in Windows 2000. Version 2.0 with Service Pack 2 requires Windows 2000 with SP4 plus KB835732 or KB891861 update, Windows XP with SP2 or later and Windows Installer 3.1 (KB893803-v2) . It shipped with Windows Server 2003 R2 (not installed by default).
.NET Framework 3.0 .NET Framework 3.0, formerly called WinFX was released on 21 November 2006. It includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems. It is also available for Windows XP SP2 and Windows Server 2003 as a download. There are no major architectural changes included with this release; .NET Framework 3.0 uses the Common Language Runtime of .NET Framework 2.0. Unlike the previous major .NET releases there was no .NET Compact Framework release made as a counterpart of this version. .NET Framework 3.0 consists of four major new components: Windows Presentation Foundation (WPF), formerly codenamed Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies. Windows Communication Foundation (WCF), formerly codenamed Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services. Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using workflows. Windows CardSpace, formerly code-named InfoCard; a software component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website.
Service Pack 1 The .NET Framework 3.5 Service Pack 1 was released on 11 August 2008. This release adds new functionality and provides performance improvements under certain conditions, especially with WPF where 20-45% improvements are expected. Two new data service components have been added, the ADO.NET Entity Framework and ADO.NET Data Services. Two new assemblies for web development, System.Web.Abstraction and System.Web.Routing, have been added; these are used in the ASP.NET MVC Framework and, reportedly, will be utilized in the future release of ASP.NET Forms applications. Service Pack 1 is included with SQL Server 2008 and Visual Studio 2008 Service Pack 1.It also featured a new set of controls called "Visual Basic Power Packs" which brought back Visual Basic controls such as "Line" and "Shape". .NET Framework Client Profile
5
On 28 July 2009, a second release of the .NET Framework 4 beta was made available with experimental software transactional memory support. Whether this functionality will be available in the final version of the framework has not been confirmed. On 19 October 2009, Microsoft released Beta 2 of the .NET Framework 4. At the same time, Microsoft announced the expected launch date of .NET Framework 4 as the 22 March 2010. The ship date should be close to, but is not identical to, this date. In conjunction with .NET Framework 4, Microsoft will offer a set of enhancements, codenamed Dublin, for Windows Server 2008 application server capabilities. Dublin will extend IIS to be a "standard host" for applications that use either WCF or WF. There are lot of new features in ASP.Net 4.0 like html, jscript snippets, new development profiles, generate form usage, enablePersistedSelection, web.config transformation, compression enabling for session values etc.
.Net Framework Architecture The Microsoft .NET platform consists of five main components, as shown in Figure 1-1. At the lowest layer lies the operating system (OS), which can be one of a variety of Windows platforms, including Windows XP, Windows 2000, Windows Server 2003, Windows ME, and Windows CE. As part of the .NET strategy, Microsoft has promised to deliver more .NET device software to facilitate a new generation of smart devices. On top of the operating system is a collection of specialized server products that shortens the time required to develop large-scale business systems. These server products include Application Center, BizTalk Server, Commerce Server, Exchange Server, Host Integration Server, Internet Security and Acceleration Server, and SQL Server.
Since web services are highly reusable across the Web, Microsoft provides a number of building-block services (officially called .NET Services) that
7
Figure 1-2 The .Net Framework Architecture The most important component of the framework is the CLR. If you are a Java programmer, think of the CLR as the .NET equivalent of the Java Virtual Machine (JVM). If you don't know Java, think of the CLR as the heart and soul of the .NET architecture. At a high level, the CLR activates objects, performs security checks on them, lays them out in memory, executes them, and garbage-collects them. Conceptually, the CLR and the JVM are similar in that they are both runtime infrastructures that abstract the underlying platform differences. However,
8
13
.Net Framework Component Common Language Runtime (CLR) The most important component of the .NET Framework is the Common Language Runtime (CLR). The CLR manages and executes code written in .NET languages and is the basis of the .NET architecture, similar to the Java Virtual Machine. The CLR activates objects, performs security checks on them, lays them out in memory, executes them, and garbage-collects them. The common language runtime facilitates the followings:
Run-time environment o CLR Compiles application into the runtime, compile the IL code into native code, execute the code. Run-time services. o Memory management, o Type safety, o Enforces Security, o Exception Management o Thread support o Debugging support
14
Class loader, which loads classes into CLR. MSIL to native code compiles, this converts MSIL code into native code. Code manager, this manages the code during execution. Memory allocation and Garbage collector, this performs automatic memory management. Security engine, this enforces security restrictions as code level security folder level and machine level security using tools provided by Microsoft .NET and using .NET Framework setting under control panel. Type checker, which enforces strict type checking. Thread support, which provides multithreading support to applications. Exception manager, which provides a mechanism to handle the runtime exceptions handling. Debug engine, which allows developer to debug different types of applications. COM marshaler, which allows .NET applications to exchange data with COM applications. Base class library support, which provides the classes (types) that the applications need at run time.
Understanding CLR To execute the program and gain all the benefits of managed execution environment we write code in a language which is supported by CLS that is .NET Framework. The language compiler compiles the source code into the MSIL code which consists of CPU- independent code and instructions which is platform independent. MSIL consists of the followings:
Instructions that enables to perform arithmetic and logical operations Access memory directly. Control the flow of execution, Handles exceptions,
MSIL code can be compiling into CPU specific instructions before executing, for which the CLR requires information about the code which is nothing but metadata. Metadata describes the code and defines the types that the code contains as well referenced to other types which the code uses at run time. An assembly consists of portable executable file. At the time of executing PE file the class loader loads the MSIL code and the metadata form the portable executable file into the run time memory. Before the execution of PE file it passes the code to the native code compiler for compilation, IL to native code compilation is done by JIT compiler. For different CPU architecture and compilers for the IL code in to the native instructions. Features of the Common Language Runtime The CLR has the following Fractures
Thread execution support, Code execution, Code safety verification, Compilation. o MSIL to Native Code. Code Security based on Trust (granted permission to execute code. Code level, Folder level, Machine level) These features are intrinsic to the managed code that runs on the common language runtime. Managed multithreading support and monitor the threads. Application domain contains one or more threads to execute. Manages interoperability with unmanaged code, and COM marshaling A structured exception handling mechanism, The infrastructure and managed execution process, memory management and garbage collection.
Common Type System (CTS) Common Type System (CTS) describes how types are declared, used and managed in the runtime and facilitates cross-language integration, type safety, and high performance code execution. The common type system performs the following functions: Establishes a framework that enables cross-language integration, type safety, and high performance code execution. Provides an object-oriented model that supports the complete implementation of many programming languages. Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. The Common Type System can be divided into two general categories of types,
16
17
22
25
26