Summary of new features for each version of the. Net Framework (i)

Source: Internet
Author: User
Tags expression engine

New features of the. Net Framework 4.5

A recent interview saw a question asking about the new features of the. Net Framework. Usually also take up to use, the new version came out, the new feature is a glance, also did not go to look carefully. This time, just take a moment to always (turn) the knot (translate) The new features that each version brings in comparison to the previous version. The main source of reference is MSDN, which is the original link:

reference:https://msdn.microsoft.com/en-us/library/ms171868 (v=vs.110). Aspx#core

Well, we'll start with 4.5.

Catalog Table of Content

1. Core new features and improvements to the "this article"

2. Managed Extensions Framework

3. Asynchronous file operations

4. Tools

5. Parallel Computing

6. Website

7. Network programming

8.WPF

9.WCF

Ten. WF

11. Portable Class Library

1. Core features and improvements

1). Reduces the need for system restarts when installing the framework 4.5. The 4.5 installation should replace some 4.0 of the files, so these files are required to be replaced (writable) at installation time. 4.5 Introduces a restart Manager (Restart Manager) that detects a running 4.0 of programs and tries to close them (a prompt box will let the user confirm the program to be closed) to avoid rebooting the system. But there are some programs that cannot or should not be shut down, and it is still necessary to restart the system.

If you want to publish your own program and bring your own framework installation package (Chained Instaler), you can also set command-line options so that the user installs your package that appears. The framework comes with the Close Program prompt box.

Reference: https://msdn.microsoft.com/en-us/library/hh527997 (v=vs.110). aspx

PS: This new feature seems to be of little use, and it doesn't matter if the development environment does not restart the system, and when it restarts, you can take a look at the headlines. Production environment, it is not 100% do not need to restart, it does not seem to play a big role.

2). Large arrays of more than 2GB are supported on 64-bit systems. However, if you have this feature, you need to set the Gcallowverylargeobjects configuration item in the configuration file:

< Configuration >  < Runtime >    <  enabled= "true"/>  </runtime>  </configuration>

PS: No such a large array, what kind of scenes will use such a large array?

3). Start backing up the server for background garbage collection. Background Garbage collection starts from 4.0, but only the workbench (WorkStation) environment is supported. 4.5 Start support server. Garbage collection adjusts itself to different scenarios. We can according to the characteristics of the workload. Set the type of garbage collection by modifying the settings for the configuration file. The CLR currently provides two types of garbage collection: Workbench and server.

Workbench garbage collection is suitable for a variety of client workstations as well as standalone PCs. It is the default setting for <runtime>/<gcserver> in the configuration file. It can run in concurrent or non-concurrency mode. Both the garbage collection and the managed main thread run concurrently in concurrent mode. Starting with 4.0, background garbage collection replaces concurrent garbage collection.

Server garbage collection is suitable for high throughput and extended server applications. Server garbage collection can be non-concurrent or background.

For background garbage collection, it executes in a separate thread and only performs garbage collection on the 2-generation heap.

Objects in the 0 and 1 generations (ephemeral generations) are using foreground garbage collection (Foreground garbage Colletion), and the background garbage collection thread and the program main thread are suspended until the recycle is resumed when the foreground garbage collection starts.

reference:https://msdn.microsoft.com/en-us/library/ee787088 (v=vs.110). aspx#background_garbage_collection

4). On multi-core processor systems, background JIT compilation can be supported to increase program startup speed.

Reference:https://msdn.microsoft.com/en-us/library/system.runtime.profileoptimization (v=vs.110). aspx

5). You can set the time-out period for the regular expression engine. There is no time-out in previous versions. This time can be created individually on the Regex object or set in the AppDomain to be applied to all regex objects. The default value is Regex. Infinitematchtimeout, no timeout.

usingSystem;usingSystem.Text.RegularExpressions; Public classexample{ Public Static voidMain () {AppDomain domain=Appdomain.currentdomain; //Set A timeout interval of 2 seconds.Domain. SetData ("Regex_default_match_timeout", Timespan.fromseconds (2)); Object Timeout= domain. GetData ("Regex_default_match_timeout"); Console.WriteLine ("Default Regex match timeout: {0}", timeout==NULL?"<null>": timeout); Regex RGX=NewRegex ("[Aeiouy]"); Console.WriteLine ("Regular expression pattern: {0}", RGX.      ToString ()); Console.WriteLine ("Timeout interval for this regex: {0} seconds", RGX.   Matchtimeout.totalseconds); }}//The example displays the following output://Default regex match timeout:00:00:02//Regular expression pattern: [Aeiouy]//Timeout interval for this regex:2 seconds

Reference: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.matchtimeout (v=vs.110). aspx

6). You can set the default culture for the AppDomain.

Reference:https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo (v=vs.110). aspx

7). Console console supports UTF-16 encoding.

8). The sorting and comparison of strings is supported by different cultural versions of the encoding.

9). Better performance when reading resources.

10). Improved ZIP compression, reducing the size of files after compression.

11). You can customize a reflection context to override the default reflection behavior. The function of the reflection context is to provide a property (Attribute) that modifies the member or method of the reflected type at run time. For example, add a source code with no attributes, or remove a property from a source code. This gets a custom property when you use reflection to get the properties of a type member or method.

Reference:https://msdn.microsoft.com/en-us/library/system.reflection.context.customreflectioncontext (v=vs.110) . aspx

12). When the class System.Globalization. IdnMapping is used on Win8, supports the 2008 version of Idna (internationalized Domain Names in applications). Class System.Globalization. IdnMapping is an Internet domain name that supports non-ASCII encoding.

Reference:https://msdn.microsoft.com/en-us/library/system.globalization.idnmapping (v=vs.110). aspx

13). When the. Net Framework is running on Win8, the comparison of strings is proxied to the operating system that implements Unicode 6.0. If you are running on another platform, the. Net Framework uses its own string comparison, which is based on unicode5.x.

14). The hash code of the string can be computed based on the application domain.

15). Type reflection supports splitting between the type and TypeInfo classes.

Summary of new features for each version of the. Net Framework (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.