简体   繁体   English

什么相当于.net核心中的nuget目标文件

[英]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.

相关问题 .NET Core / .NET Standard 中 PropertyInfo.ReflectedType 的等价物是什么? - What's the equivalent to PropertyInfo.ReflectedType in .NET Core / .NET Standard? In .NET Core, ASP.NET Core - What is the relationship between Package, Reference, NuGet Package, DLL file, Namespace - In .NET Core, ASP.NET Core - What is the relationship between Package, Reference, NuGet Package, DLL file, Namespace Visual Studio NuGet:为什么依赖包的.targets文件没有执行? - Visual Studio NuGet: Why dependent package's .targets file is not executed? IAuthenticationFilter 的 .NET Core 等价物是什么? - What is the .NET Core equivalent of IAuthenticationFilter? 来自 Net Core 的“ProducesResponseType”的 .NET 等价物是什么? - What is the .NET equivalent of "ProducesResponseType" from Net Core? 是否有等效于 .NET Core 的 IControllerActivator 的 .NET Framework? - Is there a .NET Framework equivalent to .NET Core's IControllerActivator? .net的geteuid()等价于什么? - What's the .net equivalent of geteuid()? 什么是CultureInfo.GetCultures是.NET Core - What is the equivalent of CultureInfo.GetCultures is .NET Core .NET Core中的Assembly.GetEntryAssembly()相当于什么? - What is the equivalent of Assembly.GetEntryAssembly() in .NET Core? 什么是Windows服务的.NET Core等效项 - What is the .NET Core equivalent of Windows Services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM