Solution: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version
The problem:
You’re building a setup project in Visual Studio (aka deployment project or installer project) and find the following warning in the build output:
Why this is happening:
The project you want to deploy (using the setup project) targets a more recent .NET Framework than specified in the setup project’s launch conditions. In my case, the project targets .NET Framework 4.7: Meanwhile, the setup project was still checking for .NET Framework 4.6.1 as a launch condition (requirement on the target machine).
The solution: Update the launch condition version to match the target framework of your project.
In the Setup Project, double click on ‘Microsoft .NET Framework’ to show its properties. Then change the .NET Framework version in the dropdown list:
Update April 2024: What about .NET Core and later .NET versions?
There’s nothing shown under “detected dependencies”, so changing the target framework as shown above is not possible. Note that this issue only appeared after I upgraded a .NET framework solution to .NET 8 and tried reusing the installer project. Opening the .vdproj file and removing the reference to .NET framework fixed the issue:
One more thing: Check the prerequisites
While this has nothing to do with the warning, you might as well check which version of the .NET framework your setup program will install (if any). Right click on the setup project and select ‘Properties’. In the Property Pages dialog, click on ‘Prerequisites…’:
Possibly related (but probably not)
7 thoughts on “Solution: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version”
Thank you very much. I often struggle to find good help with setup projects as it seems to have generally fallen out of favour. This guide instantly addressed and solved my problem. It took me longer to write this note than to fix my issue.
Thank-you. This resolved an issue I have.
Thank you very much. I often struggle to find good help with setup projects as it seems to have generally fallen out of favour. This guide instantly addressed and solved my problem. It took me longer to write this note than to fix my issue.
I’m glad this post helped you! I almost didn’t publish it because I didn’t think there would be much interest in it.
Thank you very much. This post has helped me, too.
Thanks!
Thank you!
Thank you, this helped me as well.