简体   繁体   中英

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.

I created a NUnit (version 3.10.1 ) project in my solution. The thing that I can't understand is: why the framework version is the 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.

Why this NUnit project is using an old framework version? 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.

When you create a new project, you specify the framework to target. You created this one to target .NET Core.

To change your project to target Full framework 4.5.2:

  • Right click the csproj and select edit <yourprojectname>.csproj
  • Locate the <TargetFramework> element
  • Change it from netcoreapp2.1 to net452
  • Close the csproj file

For more info on .NET Core, you should have a look at the About .NET Core documentation.

.NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications.

And taken from the .NET Core on Wikipedia

核心与完整框架

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM