Tuesday 14 August 2012

.NET Framework 4.5

Overview of .NET Framework

The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services.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 promotes 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.
.NET Framework Main

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 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.
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.
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.
Console applications. See Building Console Applications in the .NET Framework.
Windows GUI applications (Windows Forms). See Windows Forms.
Windows Presentation Foundation (WPF) applications. See Introduction to WPF.
ASP.NET applications. See Developing Web Applications with ASP.NET.
Windows services. See Introduction to Windows Service Applications.
Service-oriented applications using Windows Communication Foundation (WCF). See Developing Service-Oriented Applications with WCF.
Workflow-enabled applications using Windows Workflow Foundation (WF). See Building Workflows in the .NET Framework.

New Features  in .NET 4.5

.NET Framework New

Core New Features and Improvements

    The following features and improvements were added to the common language runtime and to .NET Framework classes:
  • Ability to reduce system restarts by detecting and closing .NET Framework 4 applications during deployment. See Reducing System Restarts During .NET Framework 4.5 Installations.
  • Support for arrays that are larger than 2 gigabytes (GB) on 64-bit platforms. This feature can be enabled in the application configuration file. See the<gcAllowVeryLargeObjects> element, which also lists other restrictions on object size and array size.
  • Better performance through background garbage collection for servers. When you use server garbage collection in the .NET Framework 4.5, background garbage collection is automatically enabled.
  • Background just-in-time (JIT) compilation, which is optionally available on multi-core processors to improve application performance. See ProfileOptimization.
  • Ability to limit how long the regular expression engine will attempt to resolve a regular expression before it times out. See the RegexMatchTimeout property.
  • Ability to define the default culture for an application domain. See the CultureInfo class.
  • Console support for Unicode (UTF-16) encoding. See the Console class.
  • Support for versioning of cultural string ordering and comparison data. See the SortVersion class.
  • Better performance when retrieving resources. See Packaging and Deploying Resources in Desktop Apps.
  • Zip compression improvements to reduce the size of a compressed file. See the System.IO.Compression namespace.
  • Ability to customize a reflection context to override default reflection behavior through the CustomReflectionContext class.
  • Support for the 2008 version of the Internationalized Domain Names in Applications (IDNA) standard when the IdnMapping class is used on Windows 8.
  • Delegation of string comparison to the operating system, which implements Unicode 6.0, when the .NET Framework is used on Windows 8. When running on other platforms, the .NET Framework includes its own string comparison data, which implements Unicode 5.x. See the String class and the Remarks section of theSortVersion class.
  • Ability to compute the hash codes for strings on a per application domain basis. See <UseRandomizedStringHashAlgorithm> Element.


Portable Class Libraries

The Portable Class Library project in Visual Studio 2012 enables you to write and build managed assemblies that work on multiple .NET Framework platforms. Using a Portable Class Library project, you choose the platforms (such as Windows Phone and .NET for Windows Store apps) to target. The available types and members in your project are automatically restricted to the common types and members across these platforms.
For more information, see Portable Class Library Overview.

 

Managed Extensibility Framework (MEF)

The Managed Extensibility Framework (MEF) provides the following new features:
  • Support for generic types.
  • Convention-based programming model that enables you to create parts based on naming conventions rather than attributes.
  • Multiple scopes.
  • A subset of MEF that you can use when you create Metro style apps. This subset is available as a downloadable package from the NuGet Gallery. To install the package, open your project in Visual Studio 2012, choose Manage NuGet Packages from the Project menu, and search online for the Microsoft.Compositionpackage.
For more information, see Managed Extensibility Framework Overview.

Tools

Resource File Generator (Resgen.exe) enables you to create a .resw file for use in Windows Metro style apps from a .resources file embedded in a .NET Framework assembly. For more information, see Resgen.exe (Resource File Generator).

Asynchronous File Operations

In the .NET Framework 4.5, new asynchronous features were added to the C# and Visual Basic languages. These features add a task-based model for performing asynchronous operations. To use this new model, use the asynchronous methods in the I/O classes. See Asynchronous File I/O.

Parallel Computing

The .NET Framework 4.5 provides several new features and improvements for parallel computing. These include improved performance, increased control, improved support for asynchronous programming, a new dataflow library, and improved support for parallel debugging and performance analysis. See the entry What’s New for Parallelism in .NET 4.5 in the Parallel Programming with .NET blog.

Web

ASP.NET 4.5 includes the following new features:
  • Support for new HTML5 form types.
  • Support for model binders in Web Forms. These let you bind data controls directly to data-access methods, and automatically convert user input to and from .NET Framework data types.
  • Support for unobtrusive JavaScript in client-side validation scripts.
  • Improved handling of client script through bundling and minification for improved page performance.
  • Integrated encoding routines from the AntiXSS library (previously an external library) to protect from cross-site scripting attacks.
  • Support for WebSockets protocol.
  • Support for reading and writing HTTP requests and responses asynchronously.
  • Support for asynchronous modules and handlers.
  • Support for content distribution network (CDN) fallback in the ScriptManager control.
See ASP.NET 4.5 and Visual Studio 2012.

WPF

In the .NET Framework 4.5, Windows Presentation Foundation (WPF) contains changes and improvements in the following areas:
  • The new Ribbon control, which enables you to implement a ribbon user interface that hosts a Quick Access Toolbar, Application Menu, and tabs.
  • The new INotifyDataErrorInfo interface, which supports synchronous and asynchronous data validation.
  • New features for the VirtualizingPanel and Dispatcher classes.
  • Improved performance when displaying large sets of grouped data, and by accessing collections on non-UI threads.
  • Data binding to static properties, data binding to custom types that implement the ICustomTypeProvider interface, and retrieval of data binding information from a binding expression.
  • Repositioning of data as the values change (live shaping).
  • Ability to check whether the data context for an item container is disconnected.
  • Ability to set the amount of time that should elapse between property changes and data source updates.
  • Improved support for implementing weak event patterns. Also, events can now accept markup extensions.
For more information, see What's New in WPF Version 4.5 RC.

WCF
In the .NET Framework 4.5, the following features have been added to make it simpler to write and maintain Windows Communication Foundation (WCF) applications:
  • Simplification of generated configuration files.
  • Support for contract-first development.
  • Ability to configure ASP.NET compatibility mode more easily.
  • Changes in default transport property values to reduce the likelihood that you will have to set them.
  • Updates to the XmlDictionaryReaderQuotas class to reduce the likelihood that you will have to manually configure quotas for XML dictionary readers.
  • Validation of WCF configuration files by Visual Studio as part of the build process, so you can detect configuration errors before you run your application.
  • New asynchronous streaming support.
  • New HTTPS protocol mapping to make it easier to expose an endpoint over HTTPS with Internet Information Services (IIS).
  • Ability to generate metadata in a single WSDL document by appending ?singleWSDL to the service URL.
  • Websockets support to enable true bidirectional communication over ports 80 and 443 with performance characteristics similar to the TCP transport.
  • Support for configuring services in code.
  • XML Editor tooltips.
  • ChannelFactory caching support.
  • Binary encoder compression support.
  • Support for a UDP transport that enables developers to write services that use "fire and forget" messaging. A client sends a message to a service and expects no response from the service.
  • Ability to support multiple authentication modes on a single WCF endpoint when using the HTTP transport and transport security.
  • Support for WCF services that use internationalized domain names (IDNs).
For more information, see What's New in Windows Communication Foundation.

 

WF

Several new features have been added to Windows Workflow Foundation (WF) in the .NET Framework 4.5. These new features include:
  • State machine workflows, which were first introduced as part of the .NET Framework 4.0.1 (.NET Framework 4 Platform Update 1). This update included several new classes and activities that enabled developers to create state machine workflows. These classes and activities were updated for the .NET Framework 4.5 to include:
    • The ability to set breakpoints on states.
    • The ability to copy and paste transitions in the workflow designer.
    • Designer support for shared trigger transition creation.
    • Activities for creating state machine workflows, including: StateMachine, State, and Transition.
  • Enhanced Workflow Designer features such as the following:
    • Enhanced workflow search capabilities in Visual Studio, including Quick Find and Find in Files.
    • Ability to automatically create a Sequence activity when a second child activity is added to a container activity, and to include both activities in the Sequence activity.
    • Panning support, which enables the visible portion of a workflow to be changed without using the scroll bars.
    • A new Document Outline view that shows the components of a workflow in a tree-style outline view and lets you select a component in the Document Outline view.
    • Ability to add annotations to activities.
    • Ability to define and consume activity delegates by using the workflow designer.
    • Auto-connect and auto-insert for activities and transitions in state machine and flowchart workflows.
  • Storage of the view state information for a workflow in a single element in the XAML file, so you can easily locate and edit the view state information.
  • A NoPersistScope container activity to prevent child activities from persisting.
  • Support for C# expressions:
    • Workflow projects that use Visual Basic will use Visual Basic expressions, and C# workflow projects will use C# expressions.
    • C# workflow projects that were created in Visual Studio 2010 and that have Visual Basic expressions are compatible with C# workflow projects that use C# expressions.
  • Versioning enhancements:
    • The new WorkflowIdentity class, which provides a mapping between a persisted workflow instance and its workflow definition.
    • Side-by-side execution of multiple workflow versions in the same host, including WorkflowServiceHost.
    • In Dynamic Update, the ability to modify the definition of a persisted workflow instance.
  • Contract-first workflow service development, which provides support for automatically generating activities to match an existing service contract.



For more information, see What's New in Windows Workflow Foundation.

Reference Links






























No comments:

Post a Comment

Translate