Runtime Changes for Migration from .NET Framework 4.5.1 to 4.5.2

If you are migrating from the .NET Framework 4.5.1 to 4.5.2, review the following topics for application compatibility issues that may affect your app:

ASP.NET

ASP.NET MVC now escapes spaces in strings passed in via route parameters

Details

In order to conform to RFC 2396, spaces in route paths are now escaped when populating action parameters from a route. So, whereas /controller/action/some data would previously match the route /controller/action/{data} and provide some data as the data parameter, it will now provide some%20data instead.

Suggestion

Code should be updated to unescape string parameters from a route. If the original URI is needed, it can be accessed with the RequestUri.OriginalString API.

Name Value
Scope Minor
Version 4.5.2
Type Runtime

Affected APIs

-RouteAttribute(String)|

No longer able to set EnableViewStateMac to false

Details

ASP.NET no longer allows developers to specify <pages enableViewStateMac="false"/> or <@Page EnableViewStateMac="false" %>. The view state message authentication code (MAC) is now enforced for all requests with embedded view state. Only apps that explicitly set the EnableViewStateMac property to false are affected.

Suggestion

EnableViewStateMac must be assumed to be true, and any resulting MAC errors must be resolved (as explained in this guidance, which contains multiple resolutions depending on the specifics of what is causing MAC errors).

Name Value
Scope Major
Version 4.5.2
Type Runtime

Profiling ASP.Net MVC4 apps can lead to Fatal Execution Engine Error

Details

Profilers using NGEN /Profile assemblies may crash profiled ASP.NET MVC4 applications on startup with a 'Fatal Execution Engine Exception'

Suggestion

This issue is fixed in the .NET Framework 4.5.2. Alternatively, the profiler may avoid this issue by specifying COR_PRF_DISABLE_ALL_NGEN_IMAGES in its event mask.

Name Value
Scope Edge
Version 4.5
Type Runtime

Data

SqlConnection.Open fails on Windows 7 with non-IFS Winsock BSP or LSP present

Details

Open() and OpenAsync(CancellationToken) fail in the .NET Framework 4.5 if running on a Windows 7 machine with a non-IFS Winsock BSP or LSP are present on the computer.To determine whether a non-IFS BSP or LSP is installed, use the netsh WinSock Show Catalog command, and examine every Winsock Catalog Provider Entry item that is returned. If the Service Flags value has the 0x20000 bit set, the provider uses IFS handles and will work correctly. If the 0x20000 bit is clear (not set), it is a non-IFS BSP or LSP.

Suggestion

This bug has been fixed in the .NET Framework 4.5.2, so it can be avoided by upgrading the .NET Framework. Alternatively, it can be avoided by removing any installed non-IFS Winsock LSPs.

Name Value
Scope Minor
Version 4.5
Type Runtime

Affected APIs

-SqlConnection.Open()

  • SqlConnection.OpenAsync(CancellationToken)
  • |

    Entity Framework

    EF no longer throws for QueryViews with specific characteristics

    Details

    Entity Framework no longer throws a System.StackOverflowException exception when an app executes a query that involves a QueryView with a 0..1 navigation property that attempts to include the related entities as part of the query. For example, by calling .Include(e => e.RelatedNavProp).

    Suggestion

    This change only affects code that uses QueryViews with 1-0..1 relationships when running queries that call .Include. It improves reliability and should be transparent to almost all apps. However, if it causes unexpected behavior, you can disable it by adding the following entry to the <appSettings> section of the app's configuration file:

    <add key="EntityFramework_SimplifyUserSpecifiedViews" value="false" />
    

    Name Value
    Scope Edge
    Version 4.5.2
    Type Runtime

    Opt-in break to revert from different 4.5 SQL generation to simpler 4.0 SQL generation

    Details

    Queries that produce JOIN statements and contain a call to a limiting operation without first using OrderBy now produce simpler SQL. After upgrading to .NET Framework 4.5, these queries produced more complicated SQL than previous versions.

    Suggestion

    This feature is disabled by default. If Entity Framework generates extra JOIN statements that cause performance degradation, you can enable this feature by adding the following entry to the <appSettings> section of the application configuration (app.config) file:

    <add key="EntityFramework_SimplifyLimitOperations" value="true" />
    

    Name Value
    Scope Transparent
    Version 4.5.2
    Type Runtime

    Windows Presentation Foundation (WPF)

    Calling DataGrid.CommitEdit from a CellEditEnding handler drops focus

    Details

    Calling CommitEdit() from one of the System.Windows.Controls.DataGrid's System.Windows.Controls.DataGrid.CellEditEnding event handlers causes the System.Windows.Controls.DataGrid to lose focus.

    Suggestion

    This bug has been fixed in the .NET Framework 4.5.2, so it can be avoided by upgrading the .NET Framework. Alternatively, it can be avoided by explicitly re-selecting the System.Windows.Controls.DataGrid after calling System.Windows.Controls.DataGrid.CommitEdit().

    Name Value
    Scope Edge
    Version 4.5
    Type Runtime

    Affected APIs

    -DataGrid.CommitEdit()

  • DataGrid.CommitEdit(DataGridEditingUnit, Boolean)
  • |

    Intermittently unable to scroll to bottom item in ItemsControls (like ListBox and DataGrid) when using custom DataTemplates

    Details

    In some instances, a bug in the .NET Framework 4.5 is causing ItemsControls (like System.Windows.Controls.ListBox, System.Windows.Controls.ComboBox, System.Windows.Controls.DataGrid, etc.) to not scroll to their bottom item when using custom DataTemplates. If the scrolling is attempted a second time (after scrolling back up), it will work then.

    Suggestion

    This issue has been fixed in the .NET Framework 4.5.2 and may be addressed by upgrading to that version (or a later version) of the .NET Framework. Alternatively, users can still drag scroll bars to the final items in these collections, but may need to try twice to do so successfully.

    Name Value
    Scope Minor
    Version 4.5
    Type Runtime

    WPF spawns a wisptis.exe process which can freeze the mouse

    Details

    An issue was introduced in 4.5.2 that causes wisptis.exe to be spawned that can freeze mouse input.

    Suggestion

    A fix for this issue is available in a servicing release of the .NET Framework 4.5.2 (hotfix rollup 3026376), or by upgrading to the .NET Framework 4.6

    Name Value
    Scope Major
    Version 4.5.2
    Type Runtime