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:

The target version of the .NET framework in the project does not match the NET framework launch condition version...
The target version of the .NET framework in the project does not match the NET framework launch condition version…

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:

application target .NET framework
Double click on ‘Properties’ in the Solution Explorer to show this screen.

Meanwhile, the setup project was still checking for .NET Framework 4.6.1 as a launch condition (requirement on the target machine).

I had previously thought that this was due to

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:

launch condition .net framework version

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…’:

setup program prerequisites

 

Update: While I thought this issue only appears when you update you project’s target framework after having already created a setup project, it seems that it also happens when creating a new setup project. Also, changing the target framework version does not seem to update the InstallUrl (not sure if this is important).

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.