Skip to content

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

@marcpopMSFT

Description

@marcpopMSFT

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

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

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


Associated WorkItem - 281889

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 9Work items for the .NET 9 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking changein-prThis issue will be closed (fixed) by an active pull request.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions