Skip to content

C# Guide: Explain the language dependency on framework types #1760

Closed
@BillWagner

Description

@BillWagner

This stems from comments here regarding the necessity of including the System.ValueTask NuGet package. In particular, this comment:

So it seems that either I've put together some bad information. I was reading that since we are using open source Roslyn to compile C# now that you could write language extensions and have them available as a Nuget package. Basically to enhance any compiling or modifications you wanted to do to C# yourself. With that my understand was that System.ValueTuple was part of the C# 7 language as a side Nuget package. But you're saying, if I'm on the right track, it's actually a .NET framework package (which makes alot more sense). If anyone has a moment and could clarify this up for me I would appreciate it. At least the bit on the C# Nuget packages. I believe I have also relayed some information that I need to re-track.

The mental model should be that the compiler knows how to generate code for all the features. However, some features rely on particular classes or methods in a library. The NuGet packages enable developers that target older frameworks to use the new language features. ValueTuple is one example. Earlier, the async packages included Task and Task extensions that enabled async support for developers targeting earlier versions of the framework.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions