The Microsoft .NET Framework 4.5 is a highly compatible, in-place update to the .NET Framework 4. By using the .NET Framework 4.5 together with the C# or Visual Basic programming languages, you can write Windows Metro style apps. The .NET Framework 4.5 includes significant language and framework enhancements for C# and Visual Basic so that you can more easily write asynchronous code, the blending of control flow in synchronous code, a responsive UI, and web app scalability. The .NET Framework 4.5 adds substantial improvements to other functional areas such as ASP.NET, Managed Extensibility Framework, Windows Communication Foundation, Windows Workflow Foundation, and Windows Identity Foundation. The .NET Framework 4.5 delivers better performance, reliability, and security.
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 the PreSendRequestHeaders 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):
New workflow feature. A resource manager that's using the EnlistPromotableSinglePhase method (and therefore implementing the IPromotableSinglePhaseNotification interface) can use the new Transaction.PromoteAndEnlistDurable method to request the following:
- Promote the transaction to a Microsoft Distributed Transaction Coordinator (MSDTC) transaction.
- Replace IPromotableSinglePhaseNotification with an ISinglePhaseNotification, which is a durable enlistment that supports single phase commits.
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. The following new unmanaged profiling APIs provide more robust profiling:
- CORPRFASSEMBLYREFERENCEINFO Structure
- CORPRFHIGH_MONITOR Enumeration
- ICorProfilerCallback6::GetAssemblyReferences Method
- ICorProfilerInfo5::GetEventMask2 Method
- ICorProfilerInfo5::SetEventMask2 Method
- ICorProfilerAssemblyReferenceProvider::AddAssemblyReference Method
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.
- ICorDebugProcess7::SetWriteableMetadataUpdateMode Method
- ICorDebugILFrame4::EnumerateLocalVariablesEx Method
- ICorDebugILFrame4::GetLocalVariableEx Method
- ICorDebugILFrame4::GetCodeEx Method
- ICorDebugFunction3::GetActiveReJitRequestILCode Method
- ICorDebugILCode2::GetInstrumentedILMap Method
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.