PresentationFramework problem

silvano diliso 0 Reputation points
2024-04-18T10:00:35.6533333+00:00

I'm developing an app on VS2022 C# .NET4.5.2 WPF upgraded to .NET4.8

After the upgrade when running the .exe file on WIN11 I get the following error:

"Not possible to load th efile or assembly 'PresentationFramework', Version 3.0.0.0, Culture=neutral PublicKeyToken=31bf3856ad364e35 or one of its relative dependencies. Not possible to find the specified file"

How can I solve this problem?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,934 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,787 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
337 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,958 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. EckiS 906 Reputation points
    2024-04-18T15:37:45.4766667+00:00

    when you project is build for .NET Framework 4.8, it should load PresentationFramework 4.0,
    not 3.0.
    When you look at the project referneces in Visual Studio: what does it display for PresentationFramework?

    0 comments No comments

  2. Hui Liu-MSFT 48,571 Reputation points Microsoft Vendor
    2024-04-19T07:09:56.17+00:00

    Hi,@silvano diliso. Welcome to Microsoft Q&A. It seems like there might be a mismatch in the version of the PresentationFramework assembly that your application is trying to load and the version available in your environment. You could try the following steps:

    Check references: Make sure your project references the correct version of the PresentationFramework assembly.

    Check App.Config: If your application has an app.config file, remove any binding redirects related to PresentationFramework.

    Check dependencies: If your project depends on any third-party libraries or packages, update all dependencies to the latest version that supports .NET Framework 4.8.

    Check target framework: Double check that your project is correctly targeting .NET Framework 4.8. You can verify this by right-clicking the project in Visual Studio, selecting Properties, and navigating to the Application tab.

    Check your environment: Make sure .NET Framework 4.8 is installed on your Windows 11 computer. If necessary, you can download and install it from the Microsoft website.

    Rebuild Solution: After making any necessary changes, rebuild your solution to ensure that all changes are applied correctly.


    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

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.