Are there a reason that msbuild would not import build/xxx.targets automatically from tool package in contrast from normal package? #12128
Unanswered
tny-cesilco
asked this question in
Q&A
Replies: 1 comment
-
|
This is by design in MSBuild/NuGet. When a package is installed as a .NET tool, it’s treated purely as a CLI tool, not as a dependency that participates in the project’s build graph. That means:
The reasoning is that tools are meant to run commands in isolation (dotnet tool run …) rather than injecting build logic into every project. If you want a package to automatically trigger a target on restore/build, it must be a normal package, not a global tool. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since we can install dotnet tool globally I would like to write some tool that trigger command on restore package on every project. So I have write
.targetsfile insidebuildfolder and pack it as a nupkg then installBut that seem to trigger if the package is install as normal package, not installed as tool
Are there any problem or concern that this was not a feature of msbuild?
Beta Was this translation helpful? Give feedback.
All reactions