Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Target netstandard 2.1 preview

How can we set netstandard 2.1 preview as target framework within a csproj file?

The following does not work:

<TargetFramework>netstandard2.1</TargetFramework>

dotnet core 2.1 preview sdk is installed.

like image 356
Florian Avatar asked Apr 01 '18 17:04

Florian


People also ask

Is Netstandard obsolete?

NET Standard 2.1 will be the last version of . NET Standard, . NET 5 and all future versions will continue to support .

Can I use .NET standard 2.1 in .NET Framework?

NET Core tools for Visual Studio 2015 if you cannot upgrade to Visual Studio 2017 or a later version. . NET Framework doesn't support . NET Standard 2.1.

What .NET Framework should I target?

I would recommend moving to the . Net 4.0 Client Profile. Although it doesn't have a large install base yet, it's a small download that your users can easily install. If you don't want your users to need to download the framework, you should target 3.5, which most people already have.


1 Answers

.NET Standard 2.0 is the latest available .NET Standard. Libraries targeting .NET Standard 2.0 can be used by .NET Core 2.1 and all frameworks that support .NET Standard 2.0.

If you would like to target .NET Core 2.1, use this TargetFramework: netcoreapp2.1

like image 51
Alex Ghiondea - MSFT Avatar answered Sep 29 '22 20:09

Alex Ghiondea - MSFT