项目设置中缺少Visual Studio 2017程序包选项卡 [英] Visual Studio 2017 package tab is missing in project settings

查看:187
本文介绍了项目设置中缺少Visual Studio 2017程序包选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的.NET Framework库项目.

I created a simple library .NET Framework project.

我想按照这里.

但是,包装"选项卡丢失了,下面是屏幕截图:

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

推荐答案

项目设置中缺少Visual Studio 2017软件包选项卡

Visual Studio 2017 package tab is missing in project settings

那是因为您的项目是.NET Framework库,该库仍使用packages.config来管理NuGet包.而且新的nuget软件包管理表单仅支持软件包"选项卡: PackageReference .

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类库或.NET Core项目默认情况下启用PackageReference.因此,您可以创建.NET Standard类库或.NET Core项目,然后您将在属性窗口中看到Package选项卡.

.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.

如果要对库.NET Framework项目使用打包"选项卡,则可以将项目从旧的.csproj转换为新的.csproj ,(右键单击您的项目->卸载项目- >编辑.csproj.将csproj的内容替换为以下内容:

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>

请参见从旧的csproj到新的csproj:Visual Studio 2017升级指南,以获取有关将旧的.csproj转换为新的.csproj的更多信息.

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

注意:需要删除属性中的AssemblyInfo.cs文件.

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

转换为新的.csproj之后,您将获得.NET Framework库项目的Package选项卡:

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

希望这会有所帮助.

这篇关于项目设置中缺少Visual Studio 2017程序包选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆