Alternative for Uninstall.ps1 as it is not run for

2019-09-18 11:18发布

问题:

In NuGet 3.x onwards in projects which use project.json the Install.ps1 and Uninstall.ps1 files are not run. Is there an alternate method by which I can run a powershell script when my package is uninstalled?

回答1:

No, however its not correct when you say it as NuGet 3.x onwards, NuGet 3.0+ clients working on projects using project.json way of managing dependencies will not run install/uninstall scripts but if the project is using the packages.config then these scripts are run.

One alternative you can look at is have a VS extension that listens for reference add and executes some action using VS extensibility.