缺少 "missing Produce outputs on build" 选项

Missing "missing Produce outputs on build" option

我在 visual studio 2015 年创建了全新的 .NET 核心 class 库项目。 生成的class有评论:

// This project can output the Class library as a NuGet Package.
// To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build".

我有 Visual studio Enterprise 2015,更新 2

但问题是我在项目设置中没有看到这个选项:

我从哪里得到这个选项?

即使我在 VS2015 更新 2 中也面临类似的问题。 构建项目后,我曾经将 nuget 包作为输出,但现在在构建菜单中,我们没有看到“在构建时生成输出”选项。

我可以通过以下步骤获得 nuget 包:

  1. 打开 VS2015 开发者命令提示符
  2. 将目录更改为项目的 project.json 位置
  3. 运行 “dotnet pack”,它会为您的项目创建一个 nuget 包 project_folder/bin/debug

Pre-.NET Core RC2,您的代码神奇地编译到了内存中。这有时会导致问题,因此您可以选择生成物理输出。

我现在没有任何证据可以 link 你,但我知道有人说这造成的问题多于它的价值,而且 RC2 只能编译到磁盘;因此该选项不再可用。

您看到的测试可能是项目模板遗留下来的,或者是在 RC1 中启动的项目现在已升级到 RC2。