简体   繁体   中英

How to properly publish with Nuget using Visual Studio 2017

What's the best practice to publish my library with Nuget using VS2017? The only target I see is "Folder". But I want to publish it to some external NuGet feed like MyGet, or self-hosted one.

在此处输入图片说明

According to this answer Nuget CLI in Visual Studio 2017 - How to run? and Where does Visual Studio keep it's own copy of nuget.exe? , it seems like I have to download nuget.exe separately and use it either as part of the build script or run it manually with the command line.

Does it mean there's no way to do this inside Visual Studio using the built-in NuGet package manager?

If so, where should I store nuget.exe, should I add it to my PATH environment variable or store it in my project root under /tools ?

How to properly publish with Nuget using Visual Studio 2017

If you want to publish your library with nuget to some external NuGet feed, I am afraid you have to download nuget.exe separately and use it either as part of the build script .

You could not to do this inside Visual Studio using the built-in NuGet package manager, that because there is no such option we could publish library in Visual Studio. You can check the Common Commands and Secondary Commands of NuGet package manager in Visual Studio .

If so, where should I store nuget.exe, should I add it to my PATH environment variable or store it in my project root under /tools?

You can store nuget.exe to your PATH environment variable or store it in your project root under /tools . It depends on whether you need to share your project with others. According to my experience, if you need share your project to others, I recommend you set nuget.exe under the \\tools folder, so that other users do not need to set environment variables specially on their machine.

Hope this helps.

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