【问题标题】:How does nuget.build.tasks.pack.targets get installed for msbuild如何为 msbuild 安装 nuget.build.tasks.pack.targets
【发布时间】:2018-08-01 22:45:18
【问题描述】:

我正在尝试弄清楚如何安装什么来为 msbuild 安装 nuget.build.tasks.pack.targets。

我的 CSProj 文件使用 MSBuildSDKsPath 宏,它正在解析为 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\

但我没有 SDKs 目录。我有 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild /微软 /15.0

我需要安装什么才能获得它?

【问题讨论】:

    标签: c# msbuild nuget


    【解决方案1】:

    pack 目标未连接到基于 csproj 的 .NET Framework 项目。

    只有 .NET SDK 默认导入包目标。特别是基于 PackageReference 的新 SDK 项目。

    要将 pack 目标与旧的 csproj 一起使用,您需要安装 NuGet.Build.Tasks.Pack 包。

    你可以从nuget.org.得到它 确保你设置了PrivateAssets=all

    【讨论】:

      猜你喜欢
      • 2017-10-17
      • 2020-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-15
      • 2015-12-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多