The error “the target version of the .NET Framework in the project does not match the .NET Framework launch condition version” occurs when a C# project referring C++ through COM is built.
Check the project properties for the setup and deployment project. Right click on the Setup project, select properties, go to prerequisites, and uncheck the selected .NET framework and check the required version. The same must be applied for all the projects including the setup and deployment project.
Follow the steps below to fix the error:
- Open the c++ project vcxproj in a text editor
- Find <TargetFrameworkVersion> </TargetFrameworkVersion>
- This may need to be created under the Globals PropertyGroup
- Change to required version
- Open the project in VS
- Right click the C++ project and select properties
- Select Common Properties and confirm the version
- Select Configuration Properties -> General
- Make sure the Platform Toolset is set to v90
- The error can be fixed easily by double clicking the error message.
A window shows up.
- Then you can modify the properties of the different elements on the page by right clicking them and selecting properties.
- Ensure that all the items on this page have the desired framework version. This works well in VS2010 version.
To modify the bootstrapper, open the .csproj and manually remove the instances from it:
Below are the steps to have a fix for this issue.
- select installer project
- click on the icon on top “Launch Conditions Editor”, the icon with binoculars.
- Under Launch Conditions, select “.Net framework” on the right in “Properties” select “Version” to find a drop down and change the framework to the target framework.
This fix is introduced by the ClickOnce team. They say that there must be a mismatch somewhere between the launch condition of the .NET version and the selected prerequisite on the setup project’s properties. Both must point to the same framework version.