Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build using project as the target #6499

Closed
pepone opened this issue May 28, 2021 · 7 comments
Closed

Cannot build using project as the target #6499

pepone opened this issue May 28, 2021 · 7 comments
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@pepone
Copy link

pepone commented May 28, 2021

Issue Description

After updating Visual Studio to version 16.10.0 can no longer build a solution targets using /t:

Steps to Reproduce

Create a solution with 2 C++ console projects foo and bar and save it, go to the console and try to build each project with msbuild foo.sln /t:foo and msbuild foo.sln /f:bar

Expected Behavior

You should be able to build the projects with /t:<project-name>

Actual Behavior

The build fails with an error

msbuild foo.sln /t:bar
Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 5/28/2021 11:10:53 AM.
Project "C:\Users\ppgut\source\repos\foo\foo.sln" on node 1 (bar target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|x64".
Project "C:\Users\ppgut\source\repos\foo\foo.sln" (1) is building "C:\Users\ppgut\source\repos\foo\foo\foo.vcxproj" (2) on node 1 (bar target(s)).
C:\Users\ppgut\source\repos\foo\foo\foo.vcxproj : error MSB4057: The target "bar" does not exist in the project.
Done Building Project "C:\Users\ppgut\source\repos\foo\foo\foo.vcxproj" (bar target(s)) -- FAILED.

Project "C:\Users\ppgut\source\repos\foo\foo.sln" (1) is building "C:\Users\ppgut\source\repos\foo\bar\bar.vcxproj" (3) on node 1 (bar target(s)).
C:\Users\ppgut\source\repos\foo\bar\bar.vcxproj : error MSB4057: The target "bar" does not exist in the project.
Done Building Project "C:\Users\ppgut\source\repos\foo\bar\bar.vcxproj" (bar target(s)) -- FAILED.

Done Building Project "C:\Users\ppgut\source\repos\foo\foo.sln" (bar target(s)) -- FAILED.


Build FAILED.

The attached file contains a solution with two projects that can be used to reproduce the issue.

foo.zip

@pepone pepone added bug needs-triage Have yet to determine what bucket this goes in. labels May 28, 2021
@ogaun
Copy link

ogaun commented May 28, 2021

Indeed... this is a critical bug as it will break (and is breaking) many build chains.

@eleasysoft
Copy link

+1

@larde
Copy link

larde commented May 28, 2021

FYI a workaround was found here: https://stackoverflow.com/questions/67729222/msbuild-error-msb4057-after-updating-to-vs-2019-16-10-0

@rainersigwald
Copy link
Member

Duplicate of #6373

@rainersigwald rainersigwald marked this as a duplicate of #6373 May 28, 2021
@rainersigwald
Copy link
Member

(The fix will be in Visual Studio 16.10.1, available ASAP.)

@rhuijben
Copy link

Having the same issue. Reinstalled my PC in an attempt to resolve it. Finally confirmation that this will be resolved soon

Severe issue that passed release QA

@guitarjorge24
Copy link

I've tried 6 or 7 times to download older versions of Visual Studio like 16.9.6 and 16.9.5 but have not been able to download them successfully. I keep getting this error:
image

Anyone has seen this or know how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

No branches or pull requests

7 participants