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?
PresentationFramework problem
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?
2 answers
Sort by: Most helpful
-
EckiS 906 Reputation points
2024-04-18T15:37:45.4766667+00:00 -
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.