Is there a need to update our WPF application configuration target from .NET Framework 4.5 to 4.8?

Jane Jie Chen 506 Reputation points
2021-10-27T19:53:02.413+00:00

we have a WPF application which used to target .Net framework "4.5" in Configuration file.

<configuration>  
    <startup>  
        <supportedRuntime version="v4.0" **sku=".NETFramework,Version=v4.5**"/>  
    </startup>  

Is there a need to update to .NET framework to target to "4.8"?

<configuration>  
    <startup>  
        <supportedRuntime version="v4.0" **sku=".NETFramework,Version=v4.8**"/>  
    </startup>  

we know that .NET Framework 4.8 includes .NET Frameowk 4.6 and 4.6 fixed the following double selections problem:

-------------------

(https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/runtime/4.5-4.8#windows-presentation-foundation-wpf)

Calling Items.Refresh on a WPF ListBox, ListView, or DataGrid with items selected can cause duplicate items to appear in the element
Details
In the .NET Framework 4.5, calling ListBox.Items.Refresh from code while items are selected in a System.Windows.Controls.ListBox can cause the selected items to be duplicated in the list. A similar issue occurs with System.Windows.Controls.ListView and System.Windows.Controls.DataGrid. This is fixed in the .NET Framework 4.6.

-----------------------------

If target PC includes only .Net Framework 4.5 and if WPF application configuration targets .NET framework 4.8, it will not work.

If target PC includes only .Net Framework 4.8 and if WPF application configuration targets .NET framework 4.5, it work.

If target PC includes both .Net Framework 4.5 and 4.8 and if WPF application configuration targets .NET Framework 4.5, does our WPF application uses .NET Framework 4.5 or 4.8? Thx!

Developer technologies | Windows Presentation Foundation
0 comments No comments
{count} votes

Answer accepted by question author
  1. Hui Liu-MSFT 48,711 Reputation points Microsoft External Staff
    2021-10-28T02:24:36.2+00:00

    It is recommended that you update the WPF application configuration target from .NET Framework 4.5 to 4.8.
    According to the documentation: Lifecycle FAQ - .NET Framework

    Support for .NET Framework 4, 4.5, and 4.5.1 ended on January 12, 2016.
    Support for .NET Framework 4.5.2, 4.6, and 4.6.1 will end on April 26, 2022. Customers and developers must have completed the in-place update to .NET Framework 4.6.2 or later by April 26, 2022 to continue receiving technical support and security updates.

    Updating the project solution to the latest version of the framework takes some time, but it saves time in the long run.
    On the other hand, the latest framework versions introduce new features, removes outdated features, and fix bugs that cause the application to behave unexpectedly.


    If the answer is the right solution, please click Accept Answer and kindly upvote it. If you have extra questions about this answer, please click Comment. 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.