BT

High DPI Improvements for Windows Forms in .NET 4.5.2

by Jonathan Allen on May 06, 2014 |

As part of recently released .NET 4.5.2, Windows Forms is seeing some improvements for its high DPI support. Concern over newer High DPI devices was in the forefront of the April’s Build conference. The need for this update is especially pressing now that Windows 8.1 supports a maximum scaling factor of 250%.

Here is a WinForms application running on .NET 4.5.1 with a high DPI display.

And here is the same application running on .NET 4.5.2.

To enable this feature, add a new <appSettings> element to the configuration file (app.config) and set the EnableWindowsFormsHighDpiAutoResizing element to true:

ASP.NET

ASP.NET is getting new APIs for working with background threads under IIS. Previously it was considered a bad practice to run tasks in the background because IIS could terminate the worker process at any time. The new HostingEnvironment.QueueBackgroundWorkItem method will ensure that IIS waits for these background tasks to complete. According to Microsoft, “These will enable ASP.NET applications to reliably schedule Async work items.”

Another set of APIs for ASP.NET allow better control over the HTTP headers.

New HttpResponse.AddOnSendingHeaders and HttpResponseBase.AddOnSendingHeaders methods are more reliable and efficient than HttpApplication.PreSendRequestContent and HttpApplication.PreSendRequestHeaders. These APIs let you inspect and modify response headers and status codes as the HTTP response is being flushed to the client application. These reliability improvements minimize deadlocks and crashes between IIS and ASP.NET.

New HttpResponse.HeadersWritten and HttpResponseBase.HeadersWritten properties that return Boolean values to indicate whether the response headers have been written. You can use these properties to make sure that calls to APIs such as HttpResponse.StatusCode succeeds. This enables shared hosting scenarios for ASP.NET applications.

Distributed Transactions

The next feature concerns MSDTC. This service provides applications with a way to support transactions that span multiple processes or even multiple machines.

[The] distributed transactions enhancement enables promotion of local transactions to Microsoft Distributed Transaction Coordinator (MSDTC) transactions without the use of another application domain or unmanaged code. This has a significant positive impact on the performance of distributed transactions.

Profiling

A new set of profiling APIs are also being released with .NET 4.5.2:

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT