类库项目目标框架不显示已安装的.NET版本 [英] Class Library project target framework does not display installed .NET versions

查看:583
本文介绍了类库项目目标框架不显示已安装的.NET版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个现有的解决方案,其中包含针对.NET framework 4.5.2的不同类型的项目。但是在我添加从GitHub下载的类库项目的同一解决方案中,它总是默认为.NET 2.0,并且在项目属性中它会使
不显示更新的框架,所以我甚至无法将目标框架更改为4.5.2。

I have an existing solution with different types of projects targeting the .NET framework 4.5.2. But in the same solution when I add a Class Library project which is downloaded from GitHub, it always defaults to .NET 2.0 and and in project properties it does not display the newer frameworks so I cannot even change the target framework to 4.5.2.

推荐答案

确定它是".NET Framework" 2.0"项目?不是".NET Standard 2.0"。 ?

Are sure it's a ".NET Framework 2.0" project ? Not a ".NET Standard 2.0" ?

因为.NET Standard项目是一种特定的项目,我们无法改变项目的类型。

Because the .NET Standard projects are a specific kind of project, and we can't change the the kind of project.

你可以引用".NET Standard 2.0"。使用".NET Framework 4.6"项目,如果你不能升级.NET版本,解决方案是用.NET 4.5.2创建一个新的类库并添加所有文件。

You can reference a ".NET Standard 2.0" with a ".NET Framework 4.6" project, if you can't upgrade the .NET version, the solution is to create a new class library with .NET 4.5.2 and adding all files.

问候, 


这篇关于类库项目目标框架不显示已安装的.NET版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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