Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 package tab is missing in project settings

Tags:

I created a simple library .NET Framework project.

I would like to generate NuGet packages after build as described here.

However, the Package tab is missing, here is a screenshot:
screenshot

like image 589
LLPeter Avatar asked Nov 14 '17 10:11

LLPeter


People also ask

How do I add a package to Visual Studio?

Set up Visual StudioIn Visual Studio, select Tools, and then select Options. Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source.

How do I open the package manager console in Visual Studio?

To open the Package Manager Console in Visual Studio, select Tools > NuGet Package Manager > Package Manager Console from the top menu.

How do I get to project settings in Visual Studio?

You access project properties by right-clicking the project node in Solution Explorer and choosing Properties, or by typing properties into the search box on the menu bar and choosing Properties Window from the results.


1 Answers

Visual Studio 2017 package tab is missing in project settings

That because your project is library .NET Framework, which still using packages.config to manage NuGet packages. And Package tab is only supported by the new nuget package management form: PackageReference.

.NET Standard class library or .NET Core projects come with PackageReference enabled by default. So you can create .NET Standard class library or .NET Core project, then you will see Package tab on the properties window.

If you want to use the Package tab for library .NET Framework project, you can convert your project from the old .csproj to new .csproj, (Right click your project->Unload project->Edit .csproj. Replace the contents of your csproj with the following:

<Project Sdk="Microsoft.NET.Sdk">   <PropertyGroup>     <TargetFramework>net46</TargetFramework>   </PropertyGroup> </Project> 

See Old csproj to new csproj: Visual Studio 2017 upgrade guide for more info about convert old .csproj to new .csproj.

Note: Need to delete the AssemblyInfo.cs file in the Properties.

After convert to new .csproj, you will get the Package tab for library .NET Framework project:

enter image description here

Hope this helps.

like image 127
Leo Liu-MSFT Avatar answered Sep 20 '22 23:09

Leo Liu-MSFT