-1

So .NET Standard is a formal specification of .NET APIs that are intended to be available on all .NET implementations. I have 2 applications. UI (.NET Core 3.1) and API (.NET 4.7.2). My framework libraries are developed in .NET Standard 2.0 so I can share them between these 2 applications.

I will be developing Domain library that will mostly have business logic. I understand that not all .NET API are available in .NET Standard. So my business logic needs to stick to API available in .NET Standard.

I want know if the purpose of the .NET Standard is to develop only framework kind of libraries? Are there any drawback developing shared domain specific logic using .NET Standard?

LP13
  • 30,567
  • 53
  • 217
  • 400

1 Answers1

0

No, there is no any drawback. The difference only in choosing min required version of .NET standard (link):

App components. If you’re using libraries to break down your application into several components, my recommendation is to use netX.Y where X.Y is the lowest number of .NET that your application (or applications) are targeting. For simplicity, you probably want all projects that make up your application to be on the same version of .NET because it means you can assume the same BCL features everywhere.

Reusable libraries. If you’re building reusable libraries that you plan on shipping on NuGet, you’ll want to consider the trade-off between reach and available feature set. .NET Standard 2.0 is the highest version of .NET Standard that is supported by .NET Framework, so it will give you the most reach, while also giving you a fairly large feature set to work with. We’d generally recommend against targeting .NET Standard 1.x as it’s not worth the hassle anymore. If you don’t need to support .NET Framework, then you can either go with .NET Standard 2.1 or .NET 5. Most code can probably skip .NET Standard 2.1 and go straight to .NET 5.

Egor Popov
  • 458
  • 4
  • 12