MSBuild error MSB4057 after updating to VS 2019 16.10.0

jcsilva87 116 Reputation points
2021-05-27T20:53:54.06+00:00

The command below worked flawlessly before updating to VS 2019 16.10.0:

msbuild.exe MySolution.sln /t:Project1;Project2;Project3 /p:Configuration=Release /p:DebugType=None /p:OutputPath="C:\Users\myuser\Desktop\Build"

After the update I'm getting the message error MSB4057: the target "Project1" does not exist in the project when I try the command in Developer Command Prompt of VS 2019.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,171 questions
{count} vote

Accepted answer
  1. jcsilva87 116 Reputation points
    2021-05-28T02:12:25.747+00:00

    Now you must add ":Rebuild" after the name of the projects for it to work.

    msbuild.exe MySolution.sln /t:Project1:Rebuild;Project2:Rebuild;Project3:Rebuild /p:Configuration=Release /p:DebugType=None /p:OutputPath="C:\Users\myuser\Desktop\Build"
    
    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful