Export (0) Print
Expand All

Runtime Changes in the .NET Framework 4.5.1

.NET Framework 4.5

In rare cases, runtime changes may affect existing apps that target the .NET Framework 4 or 4.5 but run on the 4.51 runtime. They include changes in the following areas:

The Scope column in the following tables specifies the significance of each change:

  • Major. A significant change that affects a large number of apps or that requires substantial modification of code. Note that none of the runtime changes fall into this category.

  • Minor. A change that either affects a small number of apps or that requires minor modification of code.

  • Edge. A change that affects apps under very specific scenarios that are not common.

  • Transparent. A change that has no noticeable effect on the app's developer or user. The app should not require modification because of this change.





System.Diagnostics.Tracing.EventListener class

EventListener truncates strings with embedded nulls. Null characters are not supported by the EventSource class.

The change only affects apps that use EventListener to read EventSource data in process and that use null characters as delimiters.


System.Diagnostics.Tracing.EventSource class

The runtime now enforces the contract that specifies the following: A class derived from EventSource that defines an ETW event method must call the base class EventSource.WriteEvent method with the event ID followed by the same arguments that the ETW event method was passed.

An IndexOutOfRangeException exception is thrown if an EventListener reads EventSource data in process for an event source that violates this contract.

See Mitigation: EventSource.WriteEvent Method Calls


Deserialization of objects across application domains

In some cases, when an app uses two or more app domains with different application bases, trying to deserialize objects in the logical call context across app domains throws an exception.

This issue arises in a highly specific scenario. For more information and mitigation, see Mitigation: Deserialization of Objects Across App Domains.


Stream.Dispose method

In Windows Store apps, Windows Runtime stream adapters no longer call the FlushAsync method from the Dispose method.

This change should be transparent. Developers can restore the previous behavior by writing code like this:

using (System.IO.Stream stream = GetWindowsRuntimeStream() As Stream) 
   // do something 
   await stream.FlushAsync();  






minFreeMemoryPercentageToActiveService configuration setting

The setting establishes the minimum memory that must be available on the server before a WCF service can be activated. It is designed to prevent OutOfMemoryException exceptions. In the .NET Framework 4.5, this setting had no effect. In the .NET Framework 4.5.1, the setting is observed.

An exception occurs if the free memory available on the web server is less than the percentage defined by the configuration setting. Some WCF services that successfully started and ran in a constrained memory environment may now fail.

See Mitigation: minFreeMemoryPercentageToActiveService Configuration Setting.


© 2014 Microsoft