【问题标题】:Missing "missing Produce outputs on build" option缺少“缺少生成时生成输出”选项
【发布时间】:2016-06-13 06:24:06
【问题描述】:

我在 Visual Studio 2015 中创建了全新的 .NET 核心类库项目。 生成的类有注释:

// 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

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

我从哪里获得这个选项?

【问题讨论】:

    标签: c# visual-studio-2015 .net-core


    【解决方案1】:

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

    我能够使用以下步骤获取 nuget 包:

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

    【讨论】:

      【解决方案2】:

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

      我现在没有任何证据可以将您链接到,但我知道据说这导致的问题多于其价值,并且 RC2 只能编译到磁盘;因此该选项不再可用。

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-26
        • 2016-01-09
        • 1970-01-01
        • 1970-01-01
        • 2016-05-05
        • 2011-03-02
        • 2013-05-19
        • 1970-01-01
        相关资源
        最近更新 更多