Get a warning of target version of .NET framework in project does not match .NET framework in launch condition

Darryl Hoar 141 Reputation points
2024-03-20T19:16:03.0066667+00:00

Visual Studio 2019 Pro. Solution has many projects.

When I try to build solution, I get the warning:

WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 4.6.1'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#).

I checked the projects and the .NET framework is 4.5.2. I checked the launch condition of the setup project and .NET framework is 4.5.2.

How do I eliminate this warning?

Thanks.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,649 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,650 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 29,261 Reputation points Microsoft Vendor
    2024-03-21T02:54:06.1466667+00:00

    Hi @Darryl Hoar ,

    Be sure to also check the Prerequisite for the setup project property to make sure it also has Microsoft .NET Framework 4.5.2 selected.

    After you've checked that the project goal framework matches the Prerequisite and startup conditions, if the warning persists, try cleaning the solution and then rebuilding it.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.