简体   繁体   中英

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.

My CSProj files use MSBuildSDKsPath macro and that is resolving to C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\Sdks\\

But I don't have the SDKs directory. I have 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.

Only .NET SDK has the pack targets imported by default. Specifically the new SDK projects that are PackageReference based.

To use the pack target with the old csproj you need to install the NuGet.Build.Tasks.Pack package.

You can get it from nuget.org. Make sure you set PrivateAssets=all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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