# Target Framework and Language Version — .NET Core: Build, Test and Ship Web APIs

Source: https://www.geekswithgeeks.com/en/dotnet-core/proj-target-frameworks

> Choose a target framework and understand how the C# language version follows it.

## TargetFramework

`TargetFramework` such as `net10.0` says which .NET APIs your project may use. Prefer a Long-Term Support (LTS) release for production because it gets patches for longer.

## Pieces that fit together

A solution groups projects, projects reference each other, and NuGet supplies outside libraries.

![Solution, project and NuGet package connected in order.](assets/figures/dotnet-core/section-3-map.svg) — Figure 3.1 — Solution, projects and packages.

## Multi-targeting a library

A shared library can build for several frameworks at once. Note the plural `TargetFrameworks`.

```xml
<PropertyGroup>
  <TargetFrameworks>net8.0;net10.0</TargetFrameworks>
</PropertyGroup>
```

## Language version follows the framework

Each target framework has a default C# version, so you rarely set `LangVersion` yourself. Forcing a newer one on an old framework can break features that need runtime support.

**Quiz:** Why choose an LTS release for production?

- [x] It receives fixes for a longer time
- [ ] It is always faster
- [ ] It needs no SDK
- [ ] It is the only one that runs on Linux

*Answer:* It receives fixes for a longer time. LTS releases are supported longer, which reduces forced upgrades.
