项目设置中缺少Visual Studio 2017程序包选项卡

编程入门 行业动态 更新时间:2024-10-14 08:26:40
本文介绍了项目设置中缺少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程序包选项卡

本文发布于:2023-11-13 22:44:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585527.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   项目   程序包   Studio   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!