Breaking changes in .NET 6
If you're migrating an app to .NET 6, the breaking changes listed here might affect you. Changes are grouped by technology area, such as ASP.NET Core or Windows Forms.
This article indicates whether each breaking change is binary compatible or source compatible:
- Binary compatible - Existing binaries will load and execute successfully without recompilation, and the run-time behavior won't change.
- Source compatible - Source code will compile successfully without changes when targeting the new runtime or using the new SDK or component.
ASP.NET Core
Containers
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
Default console logger formatting in container images | ✔️ | ❌ | Servicing 6.0.6 |
For information on other breaking changes for containers in .NET 6, see .NET 6 Container Release Notes.
Core .NET libraries
Cryptography
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
CreateEncryptor methods throw exception for incorrect feedback size | ❌ | ✔️ | Preview 7 |
Deployment
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
x86 host path on 64-bit Windows | ✔️ | ✔️ | Servicing release |
Entity Framework Core
Extensions
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
AddProvider checks for non-null provider | ✔️ | ❌ | RC 1 |
FileConfigurationProvider.Load throws InvalidDataException | ✔️ | ❌ | RC 1 |
Repeated XML elements include index | ❌ | ✔️ | |
Resolving disposed ServiceProvider throws exception | ✔️ | ❌ | RC 1 |
Globalization
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
Culture creation and case mapping in globalization-invariant mode | Preview 7 |
Interop
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
Static abstract members in interfaces | ❌ | ✔️ | Preview 7 |
JIT compiler
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
Coerce call arguments according to ECMA-335 | ✔️ | ✔️ | Preview 1 |
Networking
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
Port removed from SPN for Kerberos and Negotiate | ❌ | ✔️ | RC 1 |
WebRequest, WebClient, and ServicePoint are obsolete | ✔️ | ❌ | Preview 1 |
SDK
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
-p option for dotnet run is deprecated |
✔️ | ❌ | Preview 6 |
C# code in templates not supported by earlier versions | ✔️ | ✔️ | Preview 7 |
EditorConfig files implicitly included | ✔️ | ❌ | |
Generate apphost for macOS | ✔️ | ❌ | Preview 6 |
Generate error for duplicate files in publish output | ❌ | ✔️ | Preview 1 |
GetTargetFrameworkProperties and GetNearestTargetFramework removed from ProjectReference protocol | ❌ | ✔️ | Preview 1 |
Install location for x64 emulated on Arm64 | ✔️ | ❌ | RC 2 |
MSBuild no longer supports calling GetType() | RC 1 | ||
OutputType not automatically set to WinExe | ✔️ | ❌ | RC 1 |
Publish ReadyToRun with --no-restore requires changes | ✔️ | ❌ | 6.0.100 |
runtimeconfig.dev.json file not generated | ❌ | ✔️ | 6.0.100 |
RuntimeIdentifier warning if self-contained is unspecified | ✔️ | ❌ | RC 1 |
Version requirements for .NET 6 SDK | ✔️ | ✔️ | 6.0.300 |
.version file includes build version | ✔️ | ✔️ | 6.0.401 |
Write reference assemblies to IntermediateOutputPath | ❌ | ✔️ | 6.0.200 |
Serialization
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
DataContractSerializer retains sign when deserializing -0 | ❌ | ✔️ | Servicing 6.0.11 |
Default serialization format for TimeSpan | ❌ | ✔️ | Servicing 6.0.2 |
IAsyncEnumerable serialization | ✔️ | ❌ | Preview 4 |
JSON source-generation API refactoring | ❌ | ✔️ | RC 2 |
JsonNumberHandlingAttribute on collection properties | ❌ | ✔️ | RC 1 |
New JsonSerializer source generator overloads | ❌ | ✔️ | Preview 6 |
Windows Forms
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
C# templates use application bootstrap | ✔️ | ❌ | RC 1 |
Selected TableLayoutSettings properties throw InvalidEnumArgumentException | ❌ | ✔️ | Preview 1 |
DataGridView-related APIs now throw InvalidOperationException | ❌ | ✔️ | Preview 4 |
ListViewGroupCollection methods throw new InvalidOperationException | ❌ | ✔️ | RC 2 |
NotifyIcon.Text maximum text length increased | ❌ | ✔️ | Preview 1 |
ScaleControl called only when needed | ✔️ | ❌ | Servicing 6.0.101 |
Some APIs throw ArgumentNullException | ❌ | ✔️ | Preview 1-4 |
TreeNodeCollection.Item throws exception if node is assigned elsewhere | ❌ | ✔️ | Preview 1 |
XML and XSLT
Title | Binary compatible | Source compatible | Introduced |
---|---|---|---|
XmlDocument.XmlResolver nullability change | ❌ | ✔️ | RC 1 |
XNodeReader.GetAttribute behavior for invalid index | ✔️ | ❌ | Preview 2 |
See also
Feedback
Submit and view feedback for