"Target Framework not supported" error on opening a project of custom type - VS2022
We have an extension for Visual Studio that provides a custom project type implemented using MPF -
This project type that our extension provides used to work fine till VS2019.
In VS2022 also creating projects of this type and other project features work fine after installing the extension, but in some machines gives following issue -
- Create a project of this custom type
- Close solution and then reopen the project. Shows "Target framework not supported error"-
- Nowhere in project template or project file we have specified target as .NET Framework 4.0
- Also .NET Framework 4.0 is already installed in the machine.
- .NET Framework 4.8 is also installed
- If we select "Update the target to .NET Framework 4.8" in the prompt above, there is no update to the project file, no error shown but the project is shown as unloaded in solution.
- So there is no way to open the project.
It works the first time (on creating a new project of this type). It is only when we close and reopen the project, get this error.
Any pointers on what could be the issue and how to resolve this would be of great help.
Welcome to Microsoft Q&A forum.
Is any referenced dll or package which target .NET Framework 4.0? as I notice that the custom project type implemented using MPF.
Since the error message do mention that the project targets .NET Framework 4.0, I may suggest you double check your extension/project.
Besides, as .NET Framework 4.0 is no longer supported, may I know how you installed it on the machine? And can you verify that it was installed successfully? Lee shared a workaround about installing .NET Framework 4.0 here: How to target .NET Framework 4.0 in VS 2022 on Windows 11?, does it also work in your scenario?
Sign in to comment