Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 928
Snoopy Avatar asked Jan 20 '26 09:01

Snoopy


1 Answers

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

like image 91
M. Artem Avatar answered Jan 23 '26 02:01

M. Artem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!