Relationship between C# 8.0, NET Core 3.0 and Visual Studio

The C# language comprises a specification as well as the reference compiler called Roslyn.

A .Net version (4.8 or .net Core 3) represents the framework (a set of APIs) which sit atop a managed runtime (the CLR) that executes the compiled program (in intermediate language, a type of assembly code).

While ideally the C# language would be platform agnostic, and independent from the framework and runtime, over the history of C# several pivotal language features were devised where either the current versions of the CLR did not allow for the feature, or the feature was based on higher-level types and framework additions (for example Async-Await in C# 5, and value tuples to a certain extent in C# 7).

With C# 8, language features such as Async streams and ranges require new framework types that similarly do not exist in current/earlier versions of the frameworks. The new default interface members require CLR changes. As such these language features (the syntax) will not compile against earlier framework and CLR versions.

Unlike previous language iterations, Microsoft is not releasing these requirements within the new .Net Framework version 4.8 . Instead they are pushing .Net Core 3.0 as the reference platform, allowing them to potentially iterate faster moving forward.

In regards to Visual Studio, while you could write code in C# 8 within an earlier version of the IDE and compile it against the .Net Core 3.0 runtime, you would lose out on a significant amount of tooling, simplicity, and developer experience. The tooling around syntax highlighting, completion, code fixes, etc. rely on Roslyn which provides rich code analysis APIs.

Since the framework and language deployments are not perfectly synchronized, using the Visual Studio previews provide (mostly) compatible framework and language versions for testing the new features of both.

A good reference is the section ‘Platform dependencies’ in the Building C# 8.0 blog post.

Edit:

To answer the comment question 'How is C# 8 installed': The language spec is implemented and delivered as a compiler (Roslyn). Please see the Roslyn GitHub repository which outlines how the compiler is built, released, and installed - with or without a specific Visual Studio install.


Update after release of .NET Core 3

Some features added in C# 8.0 require .NET Core 3.0, so these have a tighter relationship than C#/.NET had before. The pair can be acquired as a workload through VS, but keep in mind C# 8.0 and .NET Core 3.0 don't require VS; you can use these in other IDEs.

The C# language versioning document describes the language/.NET relationships in more detail.

For some pragmatic details, you can read how to target C# 8.0 in Visual Studio.

Old Answer

Take a look at An update to C# versions and C# tooling, which provides a good insight about the language as it relates to projects in Visual Studio.

In particular,

The default language version chosen in this scenario is Preview. The C# 8.0 features you have access to are based entirely on the version of the compiler (and thus the .NET SDK) that you are using. As you use future previews, you may get more (or slightly tweaked) features. When you build a project, the .NET SDK will emit a warning that this is all still in preview.

In answer to

What is the relationship between C# 8.0, NET Core 3.0 and Visual Studio?

The relationship between language, SDK, and Visual Studio version are much looser than they used to be. The language can evolve independent of .NET in any of its incarnations. That doesn't mean that will always be true. Visual Studio too is independent of language and framework. If you take a look at the Visual Studio Installer, you will see that language and .NET support are "workloads" that can be installed. The SDK exposes the language features and VS offers the tooling.

If you're going with VS 2017 for now, take a look at

  • SO Q&A on .NET Core 3.0 and VS 2017
  • This article on C# 8.0 in VS 2017

As a followup, I'm also confused as to what a new language version actually is in terms of physical deployment

It's the SDK that contains the compiler that can create the assemblies from C# 8.0 source.

Is it new assemblies deployed as part of a new visual studio deploy, or part of a net core sdk install or something else?

Part of the SDK, see above. This means nothing is "deployed" in addition to your code. Your code, whatever the version, targets a version of .NET. That said, the targeted version of .NET must exist on the machine or container.

Does C# 8 need to be added to both full framework and .NET Core?

It doesn't "need to be added". The newer versions of this framework (4.8) and SDK (.NET Core 3.0) come with C# 8.0 support.


There are two ways to get the C# 8.0 to compile:

  • Use the next Visual Studio with a Roslyn compiler that understands it. ( f.e. Visual Studio 2019)
  • Install the stand alone .NET Core SDK (3.0.0 when availible) and call 'dotnet build'

Now building for .NET Core 3.0.0 will require that same SDK to be installed.

Building for .NET 4.8 will require the .NET Full Framework 4.8 SDK to be installed.

Both SDK will probably ship with Visual Studio 2019 or you will have to install them later to be able to target those frameworks.

So: - C# -> Roslyn compiler

  • runtime -> corresponding SDK

Small addendum: Looking at the support for new features in C#, apparantly Microsoft will not make .NET Full framework (4.8 and later) .NET Standard 2.1 compatible. Only .NET Core will continue to evolve in the future.