Skip to content

Instantly share code, notes, and snippets.

@tonytins
Last active August 27, 2020 19:26
Show Gist options
  • Save tonytins/6d139a775d7343d3cb9043fd7f75c20c to your computer and use it in GitHub Desktop.
Save tonytins/6d139a775d7343d3cb9043fd7f75c20c to your computer and use it in GitHub Desktop.

Tony's .NET Guide

Learning

Princables

Guidelines

News

Resources

Knowledge

.NET 5 and onward

Microsoft is in the middle of a massive transition from .NET Framework and .NET Core to .NET 5. .NET 5 merges Core, Standard and the Mono runtime (for non-desktop target) into a single unified framework again. Documnation for .NET Framework won't be valid with .NET 5 going forward.

.NET Core vs Framework

.NET is the platform C# is written on top of. Think of Java but better. The .NET Framework is directly tied to Windows and receives updates through it. Core is a rewrite of Framework to be free, open source, and cross-platform by making everything - including the Windows parts - modular. .NET Core is at near-feature parity with the Framework. .NET 5 is the upcoming successor to Framework and built on top off Core.

.NET Standard

The .NET Standard is a relatively new type of library meant to work with the different .NET platforms without requiring extra overhead. It's evolved alongside Core, serving as a reference too, and is the most compatible with it.

When making libraries, I recommend you use .NET Standard for this very reason, unless you're targetting the Framework before 4.6.1. However, this is thankfully becoming rare and only needed in the Enterprise. You can target both by changing <TargetFrameowkrs>:

<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>

Personal Experience

Stay with LTS

If you're new to C#, I highly recommend sticking with the most recent LTS. This should be a no-brainer but try not to focus on the latest and greatest until you've mastered the basics. .NET is now about you building almost anything instead of you building for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment