Đang chuẩn bị liên kết để tải về tài liệu:
Lập trình .net 4.0 và visual studio 2010 part 12

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Xử lý ngoại lệ đã được cải thiện trong NET 4.0 với sự giới thiệu của System.Runtime. ExceptionServices tên miền không gian, trong đó có các lớp học để xử lý ngoại lệ tiên tiến. | CHAPTER 4 CLR AND BCL CHANGES Native Code Enhancements I will not be covering changes to native code so I have summarized some of the important changes here Support for real-time heap analysis. New integrated dump analysis and debugging tools. Tlbimp shared source is available from codeplex http clrinterop.codeplex.com . Support for 64-bit mode dump debugging has also been added. Mixed mode 64-bit debugging is now supported allowing you to transition from managed to native code. Exception Handling Exception handling has been improved in .NET 4.0 with the introduction of the System.Runtime. Exceptionservices namespace which contains classes for advanced exception handling. CorruptedStateExceptions Many developers OK I might have done this too have written code such as the following try do something that may fail catch System.exception e . This is almost always a very naughty way to write code because all exceptions will be hidden. Hiding exceptions you don t know about is rarely a good thing and if you do know about them you should inevitably be handling them in a better way. Additionally there are some exceptions that should never be caught even by lazy developers such as lowdown beardy stuff such as access violations and calls to illegal instructions. These exceptions are potentially so dangerous that it s best to just shut down the application as quick as possible before it can do any further damage. So in .NET 4.0 corrupted state exceptions will never be caught even if you specify a try a catch block. However if you do want to enable catching of corrupted state exceptions application-wide e.g. to route them to an error-logging class you can add the following setting in your applications configuration file LegacyCorruptedStateExceptionsPolicy true This behavior can also be enabled on individual methods with the following attribute HandleProcessCorruptedStateExceptions 77 CHAPTER 4 CLR AND BCL CHANGES New Types Now that the lowdown changes are out of the way lets