简体   繁体   English

如何为msbuild安装nuget.build.tasks.pack.targets

[英]How does nuget.build.tasks.pack.targets get installed for msbuild

I am trying to figure out how what to install to get nuget.build.tasks.pack.targets installed for msbuild. 我试图弄清楚如何安装才能为msbuild安装nuget.build.tasks.pack.targets。

My CSProj files use MSBuildSDKsPath macro and that is resolving to C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\Sdks\\ 我的CSProj文件使用MSBuildSDKsPath宏,并且正在解析为C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ BuildTools \\ MSBuild \\ Sdks \\

But I don't have the SDKs directory. 但是我没有SDKs目录。 I have C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild /Microsoft /15.0 我有C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ BuildTools \\ MSBuild / Microsoft /15.0

What do I need to install to get it? 我需要安装什么才能获得它?

The pack targets are not wired in for csproj based .NET Framework projects. 打包目标未连接到基于csproj的.NET Framework项目中。

Only .NET SDK has the pack targets imported by default. 默认情况下,只有.NET SDK导入了打包目标。 Specifically the new SDK projects that are PackageReference based. 特别是基于PackageReference的新SDK项目。

To use the pack target with the old csproj you need to install the NuGet.Build.Tasks.Pack package. 要将包目标与旧的csproj一起使用,您需要安装NuGet.Build.Tasks.Pack包。

You can get it from nuget.org. 您可以从nuget.org获得它 Make sure you set PrivateAssets=all 确保您设置PrivateAssets=all

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM