Compatibility Issues with WPF App (.NET Framework) on Windows 11

FixBug 0 Reputation points
2024-09-25T05:08:05.2766667+00:00
  1. The application I previously built using WPF App (.NET Framework) runs well on Windows 10 (.NET Framework 4.8). However, it does not run on Windows 11 (the app does not start).
  2. In Visual Studio, I created a new project using WPF App (.NET Framework). Without adding or modifying any source code, I built and ran the project. The app crashed similarly to point 1.

Both 1 and 2 report errors in Event Viewer > Application. The error is related to ucrtbase.dll.

I have updated Windows, updated Visual Studio, and tried running the application on a different PC, but the error persists.

Could it be that Windows 11 is not compatible with WPF App (.NET Framework)?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,142 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,724 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 31,801 Reputation points Microsoft Vendor
    2024-09-25T06:27:01.79+00:00

    Hi @FixBug , WPF applications built using .NET Framework, including version 4.8, should generally run without issues on Windows 11, as Windows 11 is designed to be backward-compatible with apps developed on the .NET Framework. The error you're encountering with ucrtbase.dll (Universal C Runtime) likely indicates that the issue is related to the runtime environment rather than Windows 11's compatibility with WPF itself.

    Try to reinstall the Universal C Runtime:

    1.- Open Windows Settings

    2.- Navigate to Apps > Installed Apps

    3.- Locate the following:

    • Microsoft Visual C++ 20XX Redistributable - x64 <version>

    • Microsoft Visual C++ 20XX Redistributable - x86 <version>

    4.- Uninstall

    5.- Download & Install the latest C++ Redistributables from the Official Website: Latest supported Visual C++ Redistributable downloads | Microsoft Learn

    6.- Reboot

    Best Regards.

    Jiachen Li


    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.


  2. FixBug 0 Reputation points
    2024-09-25T07:02:26.44+00:00

    Hi @Jiachen Li-MSFT

    I have identified the cause of the error.

    The reason is that my source code uses a namespace in Japanese.

    When I changed the namespace to English, the program ran normally.

    For example:

    namespace 新しい名前空間 {//source code}
    

    Changed to:

    namespace NewNamespace {//source code}
    

    It seems there is some issue with Windows 11 causing this error.
    The Windows 10 and 11 versions I am using are in Japanese.
    However, Windows 10 does not have the error, while Windows 11 does.

    What do you think?


Your answer

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