What’s New in .NET Framework 4.5.2

0

I was not actually aware .NET 4.5.2 had been released, but Microsoft put up a post on MSDN outlining the major changes in .NET 4.5.2. I have seen a number of developers complaining about the lack of forms support in .NET. If you’re a .NET developer let us know your thoughts on this release in the comments below.

  • New APIs for ASP.NET apps. The new HttpResponse.AddOnSendingHeaders and HttpResponseBase.AddOnSendingHeaders methods let you inspect and modify response headers and status code as the response is being flushed to the client app. Consider using these methods instead of thePreSendRequestHeaders and PreSendRequestContent events; they are more efficient and reliable.

    The HostingEnvironment.QueueBackgroundWorkItem method lets you schedule small background work items. ASP.NET tracks these items and prevents IIS from abruptly terminating the worker process until all background work items have completed. This method can’t be called outside an ASP.NET managed app domain.

    The new HttpResponse.HeadersWritten and HttpResponseBase.HeadersWritten properties return Boolean values that indicate whether the response headers have been written. You can use these properties to make sure that calls to APIs such as HttpResponse.StatusCode (which throw exceptions if the headers have been written) will succeed.

  • Resizing in Windows Forms controls. This feature has been expanded. You can now use the system DPI setting to resize components of the following additional controls (for example, the drop-down arrow in combo boxes):

    ComboBox
    ToolStripComboBox
    ToolStripMenuItem
    Cursor
    DataGridView
    DataGridViewComboBoxColumn

    This is an opt-in feature. To enable it, set the EnableWindowsFormsHighDpiAutoResizing element to true in the application configuration (app.config) file:

  • New workflow feature. A resource manager that’s using the EnlistPromotableSinglePhase method (and therefore implementing theIPromotableSinglePhaseNotification interface) can use the new Transaction.PromoteAndEnlistDurable method to request the following:

    This can be done within the same app domain, and doesn’t require any extra unmanaged code to interact with MSDTC to perform the promotion. The new method can be called only when there’s an outstanding call from System.Transactions to the IPromotableSinglePhaseNotification Promote method that’s implemented by the promotable enlistment.

  • Profiling improvements.

    Previous ICorProfiler implementations supported lazy loading of dependent assemblies. The new profiling APIs require dependent assemblies that are injected by the profiler to be loadable immediately, instead of being loaded after the app is fully initialized. This change doesn’t affect users of the existing ICorProfiler APIs.

  • Debugging improvements. The following new unmanaged debugging APIs provide better integration with a profiler. You can now access metadata inserted by the profiler as well as local variables and code produced by compiler ReJIT requests when dump debugging.

    Event tracing changes. The .NET Framework 4.5.2 enables out-of-process, Event Tracing for Windows (ETW)-based activity tracing for a larger surface area. This enables Advanced Power Management (APM) vendors to provide lightweight tools that accurately track the costs of individual requests and activities that cross threads. These events are raised only when ETW controllers enable them; therefore, the changes don’t affect previously written ETW code or code that runs with ETW disabled.

Source: Microsoft Developer Network

About Author

Suril is a scientist, journalist and obsessive Microsoft observer. He holds an advanced degree in Biotechnology with minors in Biochemistry, Microbiology, and Molecular Biology. Send him tips on twitter: http://www.twitter.com/surilamin