[英]What's the equivalent of nuget targets file in .net core
I've a got a library that I distribute via Nuget. 我有一个我通过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.
在那个包中,我有一个.targets文件,它被包含在消费项目的csproj中(由nuget),这样MSBuild可以在构建期间执行任务(这有效地允许我将构建步骤注入到使用项目中。)该任务基本上调用nuget包的“tools”文件夹中包含的可执行文件。
I'm wondering how to achieve this functionality with .Net core and the new dotnet cli? 我想知道如何使用.Net核心和新的dotnet cli实现这一功能?
See the section "Import MSBuild targets and props files into project" at http://docs.nuget.org/Create/Creating-and-Publishing-a-Package 请参阅http://docs.nuget.org/Create/Creating-and-Publishing-a-Package上的 “将MSBuild目标和道具文件导入项目”部分。
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. 顺便说一下,你可以在创建nuget包之后编辑nuget包,如果有人在dnx前环境中恢复,目标就会起作用,但是
dnu
不会运行这些脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.