How can I find executables installed by NuGet packages?

Chris

My project needs to be packaged as a zip file for deployment. I want to create this zip file in a post build step.

To achieve this I have installed a 7-Zip command line package via NuGet. This package provides an executable which I want to call in my post build step. I know that I could call it by providing the path to the installed package but this path contains the version number of the package so a direct reference will break when the package is updated.

Is there some MSBuild variable that I could use to get the path to my installed packages' tools path?

Nick Nieslanik

I don't think there's a way to avoid the version number in the path for the package, but you can do something like what the SlowCheetah nuget package does to make it more portable between developer machines, etc.

<PropertyGroup Label="SlowCheetah">
 <SlowCheetahToolsPath>$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\SlowCheetah.2.5.12\tools\))</SlowCheetahToolsPath>
 <SlowCheetah_EnableImportFromNuGet Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='' ">true</SlowCheetah_EnableImportFromNuGet>
 <SlowCheetah_NuGetImportPath Condition=" '$(SlowCheetah_NuGetImportPath)'=='' ">$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\Properties\SlowCheetah\SlowCheetah.Transforms.targets ))</SlowCheetah_NuGetImportPath>
 <SlowCheetahTargets Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='true' and Exists('$(SlowCheetah_NuGetImportPath)') ">$(SlowCheetah_NuGetImportPath)</SlowCheetahTargets>
</PropertyGroup>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to find all the available packages (and executables) that can fulfill an "alternative"?

From Dev

How can I mark all packages with installed dependents as "Automatically Installed"?

From Java

How can you find unused NuGet packages in solution?

From Dev

How do I find an installed nuget package at the console?

From Dev

How to upgrade nuget packages if the installed version is missing?

From Dev

How do I find installed packages that have no install candidate?

From Dev

How can I uninstall all the packages I've installed today?

From Dev

How to find manually installed packages?

From Dev

Where can I find the application executables in the filesystem?

From Dev

Where can I find the application executables in the filesystem?

From Java

How can I use NuGet packages in my Azure Functions?

From Dev

How can I get the list of NuGet packages available for KRuntime?

From Dev

How can I get the list of NuGet packages available for KRuntime?

From Dev

How can I find the version of Ubuntu that is installed?

From Dev

How can I find the version of Ubuntu that is installed?

From Java

How can I see the current version of packages installed by pipenv?

From Dev

How can I reinstall or recompile already installed packages in Julia?

From Dev

How can I get the installed composer packages programatically?

From Dev

How can I see the current version of packages installed by pipenv?

From Dev

How can I remove outdated installed versions of Homebrew packages?

From Dev

How can I check the version of packages to be installed with apt-get?

From Dev

How can I install "Ubuntu minimal install" packages that are not installed with it?

From Dev

How can I reset installed packages to default state?

From Dev

How can I get a list of the biggest packages currently installed in order?

From Dev

R can't find packages installed by travis

From Dev

Can't find installed packages in Lubuntu

From Dev

Can't find installed packages in Lubuntu

From Dev

R can't find packages installed by travis

From Dev

How can I determine which packages I have installed via homebrew and which were installed manually?

Related Related

  1. 1

    How to find all the available packages (and executables) that can fulfill an "alternative"?

  2. 2

    How can I mark all packages with installed dependents as "Automatically Installed"?

  3. 3

    How can you find unused NuGet packages in solution?

  4. 4

    How do I find an installed nuget package at the console?

  5. 5

    How to upgrade nuget packages if the installed version is missing?

  6. 6

    How do I find installed packages that have no install candidate?

  7. 7

    How can I uninstall all the packages I've installed today?

  8. 8

    How to find manually installed packages?

  9. 9

    Where can I find the application executables in the filesystem?

  10. 10

    Where can I find the application executables in the filesystem?

  11. 11

    How can I use NuGet packages in my Azure Functions?

  12. 12

    How can I get the list of NuGet packages available for KRuntime?

  13. 13

    How can I get the list of NuGet packages available for KRuntime?

  14. 14

    How can I find the version of Ubuntu that is installed?

  15. 15

    How can I find the version of Ubuntu that is installed?

  16. 16

    How can I see the current version of packages installed by pipenv?

  17. 17

    How can I reinstall or recompile already installed packages in Julia?

  18. 18

    How can I get the installed composer packages programatically?

  19. 19

    How can I see the current version of packages installed by pipenv?

  20. 20

    How can I remove outdated installed versions of Homebrew packages?

  21. 21

    How can I check the version of packages to be installed with apt-get?

  22. 22

    How can I install "Ubuntu minimal install" packages that are not installed with it?

  23. 23

    How can I reset installed packages to default state?

  24. 24

    How can I get a list of the biggest packages currently installed in order?

  25. 25

    R can't find packages installed by travis

  26. 26

    Can't find installed packages in Lubuntu

  27. 27

    Can't find installed packages in Lubuntu

  28. 28

    R can't find packages installed by travis

  29. 29

    How can I determine which packages I have installed via homebrew and which were installed manually?

HotTag

Archive