0

I have a class library in Visual Studio 2017, .Net Framework 4.6.2. I need to convert it to a Nuget package and I'm having a hard time using command prompt and nuspec file with project references. Therefore, continuing my research, I found that there is 'Generate Nuget package on build' in VS 2019.

https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli

I do not see this command in VS Professional 2017 (version 15.9.21). Is it possible to have this option in VS 2017? Please advise. If not, I will have to install VS 2019. Also please let me know if 'Generate Nuget package on build' is available for both .Net core and .Net Standard version. Asking since the video on that page uses .NET core

SilverFish
  • 1,014
  • 6
  • 28
  • 65

1 Answers1

0

That is a feature of Net Core SDK since VS2017. You can use this option on VS2017, it is there.

Create a Net Standard or Net Core Class Library project.

Then, right-click on Project Properties -> Package

Shows Generate NuGet package on build option, under Project Propertiers, Package.

My VS is VS2017 Community 15.9.31

If you did not see that, please update your VS to the latest version.

Ethirix
  • 13
  • 7
Sara Liu - MSFT
  • 6,007
  • 1
  • 21
  • 27
  • I do not have Package menu option. Is there a way to make it visible? Are you using Professional or Enterprise version please? Mine is professional – SilverFish Apr 02 '21 at 12:33
  • @SilverFish is your project an SDK-based project? if not, convert it to one first (e.g. using [this guide](https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/)) – Martin Ullrich Apr 02 '21 at 14:35
  • @SilverFish, what is your project type., net framework or net core? All versions of VS2017 has this feature for the new-sdk lib project. If yours is a non-sdk project, please convert it to the new-sdk for `net framework` and then you will see it. If you still cannot see the feature for new-sdk projects, please share some pics with us to show that strange behavior. Or just [repair your vs](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). – Sara Liu - MSFT Apr 05 '21 at 02:03