I've a got a library that I distribute via Nuget. In that package I have a .targets file which gets included in to the csproj of the consuming project (by nuget) so that MSBuild can execute a task during build (this effectively allows me to inject build steps in to consuming projects.) That task basically calls an executable that is included in the nuget package's "tools" folder.
I'm wondering how to achieve this functionality with .Net core and the new dotnet cli?
See the section "Import MSBuild targets and props files into project" at http://docs.nuget.org/Create/Creating-and-Publishing-a-Package
Unfortunately, there's no support for custom actions. You will have to tell the consumers what to do with your package and what to run.
Btw, you can edit the nuget package after it was created and if anyone restores in a pre-dnx environment the targets will work but dnu
doesn't run those scripts.
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.