What is .NET Yesterday and Today
Are you confused about what is .NET today?
Also, confused about what is .NET Standard?
In this post, we’ll talk about what is this .NET Standard and why it has a huge set of APIs.
Let’s take a look at these infographics.
Challenges here are
- Difficult to reuse skill: Need to master 3+1 base class libraries
- Difficult to reuse code: Need to target small common denominator
- Difficult to innovate: Need implementations on each platform
Benefits here are
- Reuse skills: Master one library, not a platform
- Reuse code: Big surface area – no small common denominator
- Faster innovation: .NET Standard can grow without updating platforms
So what is .NET Standard?
.NET Standard is a specification. It represents a set of APIs that all .NET platforms have to implement.
Like what is happening in the web browsers. HTML5 is a specification, whereas the platforms are the browsers that need to support the specifications of HTML5 in order to render markups correctly.
Anyway, .NET Standard is a type of class library & provided as a NuGet package.
Difference to PCL or Portable Class Libraries
PCLs were an afterthought, i.e. each platform could decide which APIs to includes
- No systematic approach to versioning
- Computed intersection profiles
Each PCLs is targeting a specific set of platforms
- Not compatible with newer platforms
- Hard to understand compatibility relationships
How does versioning work in .NET Standard?
Higher versions incorporate all APIs from previous versions.
- Projects targeting version X.Y can reference libraries & projects targeting any version between 1.0 and X.Y
Concrete .NET platforms implement a specific version of .NET Standard
- From that platform, you can reference libraries up to that version
So there you have it, a quick intro to .NET Standard. Just remember, .NET Standard is not something that you will install in your VS2017, commonly misunderstood, it is just a class library. A new class library of .NET ecosystem.