如何从.Net Core RC2类库创建NuGet程序包 [英] How to Create NuGet Packages From .Net Core RC2 Class Libraries

查看:99
本文介绍了如何从.Net Core RC2类库创建NuGet程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中有12个项目的解决方案。我想从Visual Studio创建一个nuget程序包,但是它似乎缺少RC1中的在生成时输出产品。

I have a solution in Visual Studio with 12 projects. I would like to create a nuget package from Visual Studio, but it appears the "Produce outputs on build" that was there from RC1 is missing.

我可以继续创建一个脚本,该脚本转到每个文件夹并调用 dotnet pack,但是Visual Studio中没有一个我可以做不到的选项?

I can go ahead and create a script that goes to each folder and call "dotnet pack", but is there an option in Visual Studio that I am missing to do this?

推荐答案

将此添加到您的 project.json 文件中:

Add this to your project.json file:

"scripts": {
  "postcompile": [
    "dotnet pack --no-build --configuration %compile:Configuration%"
  ]
}

这将运行 dotnet pack 命令将打包编译成NuGet包后生成的生成输出。有关更多信息,请参见

This will run the dotnet pack command which will pack your build output produced after compilation into a NuGet package. For more info, see this.

I'我不确定如何仅在发布模式下执行此操作,所以我问了这个问题此处

I'm not sure how to only do this in release mode, so I've asked that question here.

更新

根据其他问题更新了答案。

Updated the answer based on the other question.

这篇关于如何从.Net Core RC2类库创建NuGet程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆