简体   繁体   中英

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

I have two NuGet packages, one depends on another. 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. If i will manualy install both of them - both.targets work as expected. 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. You can manually add their.targets through the import tag:

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

There is a macro for a nuget directory $(NuGetPackageRoot)

The short review of the order can be found here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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