简体   繁体   English

Visual Studio NuGet:为什么依赖包的.targets文件没有执行?

[英]Visual Studio NuGet: Why dependent package's .targets file is not executed?

I have two NuGet packages, one depends on another.我有两个 NuGet 包,一个依赖于另一个。 When i install the package which depends on another package (both of them have.targets in build folders) the.targets file of installed package is executed, but the "parent" package's.targets is not getting executed.当我安装 package 时,它依赖于另一个 package (它们在构建文件夹中都有.targets),安装的 ZEFE90A8E604A7C840E88D03A67F6B7D8 的.targets 文件正在执行,但未执行“parent”包。 If i will manualy install both of them - both.targets work as expected.如果我将手动安装它们 - both.targets 按预期工作。 Can somebody explain me why the hierarchy of packages not works here?有人能解释一下为什么包的层次结构在这里不起作用吗? Is there some workarounds about it?有一些解决方法吗?

The best way here is to look inside.target files for both of them.这里最好的方法是查看它们的 inside.target 文件。 You can manually add their.targets through the import tag:您可以通过 import 标签手动添加 their.targets:

<Import Project="$(CommonLocation)\Some.targets" />

There is a macro for a nuget directory $(NuGetPackageRoot) nuget 目录有一个宏$(NuGetPackageRoot)

The short review of the order can be found here订单的简短评论可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM