[英]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,请执行以下操作:
edit <yourprojectname>.csproj
右键单击csproj,然后选择edit <yourprojectname>.csproj
<TargetFramework>
element 找到<TargetFramework>
元素 netcoreapp2.1
to net452
将其从netcoreapp2.1
更改为net452
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.