Visual Studio 2017 package tab is missing in project settings

自作多情 提交于 2019-12-21 06:58:20

问题


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:


回答1:


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:

Hope this helps.



来源:https://stackoverflow.com/questions/47283750/visual-studio-2017-package-tab-is-missing-in-project-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!