msbuild: Solution target generation does not take into account imported targets
A target added to a project via solution project extensibility points is no longer accessible after #1497, because the injected call-arbitrary-target-in-all-projects target overrides the one imported from After.SolutionName.sln.targets
. This produces errors like
S:\msbuild>bin\Bootstrap\15.0\Bin\MSBuild.exe src\MSBuild.sln /t:PackNugetPackages /v:q
Microsoft (R) Build Engine version 15.1.523.56541
Copyright (C) Microsoft Corporation. All rights reserved.
S:\msbuild\src\Framework\Microsoft.Build.Framework.csproj : error MSB4057: The target "PackNugetPackages" does not exist in the project.
S:\msbuild\src\XMakeCommandLine\MSBuild.csproj : error MSB4057: The target "PackNugetPackages" does not exist in the project.
This regresses solutions that use a target at the solution level to restore NuGet packages, a common pattern for Xamarin.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Ensure built-in and imported targets are respected by the solution project generator. The goal is to take whatever target the user specified from the command-line and add it to the metaproj. However... — committed to jeffkl/msbuild by jeffkl 7 years ago
- Invoke NuGet.targets directly to avoid race condition caused by issue in solution targets See Microsoft/msbuild#1587 — committed to aspnet/KoreBuild by deleted user 7 years ago
- Ensure built-in and imported targets are respected by the solution pr… (#1590) * Ensure built-in and imported targets are respected by the solution project generator. The goal is to take whatever ... — committed to dotnet/msbuild by jeffkl 7 years ago
Verified fixed, thanks!! 😄