dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.17k stars 5.83k forks source link

[Breaking change]: .NET SDK will warn customers when targeting .NET standard version <2.0 #41551

Open marcpopMSFT opened 1 week ago

marcpopMSFT commented 1 week ago

Description

.NET standard versions 1.0 through 1.6 include the implementation assemblies. This is bad as it will pull those references into deps.json and other dependency locations and could get flagged by scanners. While customers can still target those versions if they want, we recommend they upgrade to 2.0 or 2.1.

More information is available at https://aka.ms/dotnet/dotnet-standard-guidance

Version

.NET 9 Preview 6

Previous behavior

Customers could target .NET Standard 1.0 through 1.6 without issue.

New behavior

warning NETSDK1215: Targeting .NET Standard prior to 2.0 is no longer recommended. See https://aka.ms/dotnet/dotnet-standard-guidance for more details.

Type of breaking change

Reason for change

https://github.com/dotnet/designs/blob/main/accepted/2024/net-standard-recommendation.md

Recommended action

Update your TargetFramework property to netstandard2.0 or netstandard2.1. If required to stay on an older .NET Standard, you can set <CheckNotRecommendedTargetFramework>false</CheckNotRecommendedTargetFramework> in your project or Directory.Build.props

Feature area

SDK

Affected APIs

No response

marcpopMSFT commented 1 week ago

CC @terrajobst for visibility