-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can only specify the first target in .sln with -target: #6503
Comments
I see this issue too (interestingly enough, meson and my project are doing about the same thing: testing generated project files from a higher-level build system). After debugging this for a while, it seems that this issue only applies to the command-line invocation of |
I'm seeing this too, and it seems possibly related to #5722 as well. You get pretty wildly different Metaproj generation when specifying either the first target, as noted in this issue, or no target at all <Target Name="Installer\Project_Product" Outputs="@(Installer_Project_ProductBuildOutput)">
<MSBuild Condition="'%(ProjectReference.Identity)' == 'C:\Projects\Product\Tools\Project.Product.HQ\Project.Product.HQ.CustomAction\Project.Product.HQ.CustomAction.csproj'" ToolsVersion="$(ProjectToolsVersion)" BuildInParallel="True" Projects="@(ProjectReference)" Properties="Configuration=Debug; Platform=x86;BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)">
<Output TaskParameter="TargetOutputs" ItemName="Installer_Project_ProductBuildOutput" />
</MSBuild>
</Target> vs if you specify any of the later targets (e.g. <Target Name="Installer\Project_Product">
<MSBuild BuildInParallel="True" SkipNonexistentProjects="%(ProjectReference.SkipNonexistentProjects)" Projects="@(ProjectReference)" Targets="Installer\Project_Product" Properties="BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" />
</Target> I referenced #5722 because, interestingly enough, |
I think this is a more interesting manifestation of the bug behind #6373. The fix will go out with VS 16.10.1 ASAP. |
Issue Description
Manually selecting all targets (with
-target:<tgt>
), except the first defined in the.sln
file, fails. Here is the relevant part of the.sln
file of our test case:Steps to Reproduce
Our failing test case: 6 linkshared.zip.
Run:
Expected Behavior
Both commands succeed.
Actual Behavior
Only the first command works. Running the second command generates
error MSB4057: The target "mycpplib_sha" does not exist in the project.
errors.Analysis
Removing the first two
Project()
calls causes the secondmsbuild
call to suddenly work, thus it is likely that the first target in the.sln
file can be specified with-target
.Versions & Configurations
msbuild -version
: 16.10.0.26302The
.sln
file was generated by meson in our Azure CI. See mesonbuild/meson#8512 (comment) for some more details.The text was updated successfully, but these errors were encountered: