简体   繁体   English

为什么使用旧版本的.NET Framework(2.1)在我的解决方案中创建一个NUnit项目?

[英]Why creating an NUnit project into my solution it use an old version of .NET framework (2.1)?

I am pretty new in C# and .NET and I have the following problem. 我在C#.NET中还很陌生 ,但存在以下问题。

I created a NUnit (version 3.10.1 ) project in my solution. 我在解决方案中创建了一个NUnit (版本3.10.1 )项目。 The thing that I can't understand is: why the framework version is the 2.1 ? 我不明白的是:为什么框架版本是2.1 Is not a very old version? 是不是很旧的版本? If I try to change it I obtain older version, I am attaching a screenshot: 如果尝试更改它,我会获得旧版本,请附上屏幕截图:

在此处输入图片说明

The strange thing is that the other project into my solution uses the .NET 4.5.2 framnework version. 奇怪的是,我的解决方案中的另一个项目使用的是.NET 4.5.2框架版本。

Why this NUnit project is using an old framework version? 为什么这个NUnit项目使用的是旧框架版本? there is a way to update it? 有办法更新吗?

What is wrong or what am I missing? 有什么问题或我想念什么?

You are targetting .NET Core, which is a completely different framework than the Full .NET Framework. 您以.NET Core为目标,这是一个与Full .NET Framework完全不同的框架。

When you create a new project, you specify the framework to target. 创建新项目时,请指定要定位的框架。 You created this one to target .NET Core. 您创建了一个针对.NET Core的对象。

To change your project to target Full framework 4.5.2: 要将项目更改为针对完整框架4.5.2,请执行以下操作:

  • Right click the csproj and select edit <yourprojectname>.csproj 右键单击csproj,然后选择edit <yourprojectname>.csproj
  • Locate the <TargetFramework> element 找到<TargetFramework>元素
  • Change it from netcoreapp2.1 to net452 将其从netcoreapp2.1更改为net452
  • Close the csproj file 关闭csproj文件

For more info on .NET Core, you should have a look at the About .NET Core documentation. 有关.NET Core的更多信息,您应该查看关于.NET Core文档。

.NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. .NET Core是由Microsoft和.NET社区在GitHub上维护的一个开源通用开发平台。 It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications. 它是跨平台的(支持Windows,macOS和Linux),可用于构建设备,云和IoT应用程序。

And taken from the .NET Core on Wikipedia 并取自Wikipedia上.NET Core

核心与完整框架

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么.net项目有时会使用旧版本的DLL? - Why does .net project sometimes use old version of dll? 在我的解决方案中创建 class 库项目,丢弃 nunit,无法识别测试 - Creating a class library project in my solution, dropped nunit, tests are not recognized 将 Web 应用项目添加到我的解决方案中,并且解决方案中的其他项目已经使用 .net 框架,我可以将 .net 核心用于新项目吗? - adding a web app project to my solution, and the other projects in the solution already use .net framework, can I use .net core for the new project? 我可以在我的 ApplicationLogic 项目(net standard 2.1)中的 MVC(.net core 3.0)项目中使用视图模型吗? - Can I use viewmodels in my MVC(.net core 3.0) project in my ApplicationLogic project (net standard 2.1) 我的项目可以引用针对较低版本.net框架的程序集吗? - Can my project reference an assembly targeting a lower version of .net framework? 将.NET Core项目发布到Nuget - 要使用哪个框架版本? - Publishing a .NET Core project to Nuget - which framework version to use? 是否可以使用命令行而不使用VS解决方案或项目文件来定位特定的.NET Framework版本或配置文件? - Is it possible to target a specific .NET Framework Version or Profile using command line without a VS solution or project file? .Net Core 2.1 项目在 IIS 上部署时不使用脚手架标识,而是使用 2016 年的旧模板 - .Net Core 2.1 project doesn't use scaffolded Identity when deploying on IIS, instead uses an old template from 2016 .NET Core解决方案设计在参考旧版本库时遇到问题 - .NET Core Solution design having issues with reference to old version libraries 面向 .NET Core 2.1 的解决方案使用旧的 System.ServiceModel.Primitives 和 System.Private.ServiceModel 构建 - Solution targeting .NET Core 2.1 builds with old System.ServiceModel.Primitives and System.Private.ServiceModel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM