Breaking changes in .NET 7
If you're migrating an app to .NET 7, 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
Core .NET libraries
Configuration
Title | Binary compatible | Source compatible |
---|---|---|
System.diagnostics entry in app.config | ❌ | ✔️ |
Cryptography
Title | Binary compatible | Source compatible |
---|---|---|
Decrypting EnvelopedCms doesn't double unwrap | ❌ | ✔️ |
Dynamic X509ChainPolicy verification time | ❌ | ✔️ |
X500DistinguishedName parsing of friendly names | ❌ | ✔️ |
Deployment
Title | Binary compatible | Source compatible |
---|---|---|
All assemblies trimmed by default | ✔️ | ❌ |
Multi-level lookup is disabled | ❌ | ✔️ |
x86 host path on 64-bit Windows | ✔️ | ✔️ |
TrimmerDefaultAction is deprecated | ✔️ | ❌ |
Entity Framework Core
Extensions
Title | Binary compatible | Source compatible |
---|---|---|
Binding config to dictionary extends values | ✔️ | ✔️ |
ContentRootPath for apps launched by Windows Shell | ❌ | ✔️ |
Environment variable prefixes | ❌ | ✔️ |
Globalization
Title | Binary compatible | Source compatible |
---|---|---|
Globalization APIs use ICU libraries on Windows Server | ❌ | ✔️ |
Interop
Title | Binary compatible | Source compatible |
---|---|---|
RuntimeInformation.OSArchitecture under emulation | ❌ | ✔️ |
.NET MAUI
Title | Binary compatible | Source compatible |
---|---|---|
Constructors accept base interface instead of concrete type | ❌ | ✔️ |
Flow direction helper methods removed | ❌ | ❌ |
New UpdateBackground parameter | ❌ | ✔️ |
ScrollToRequest property renamed | ❌ | ❌ |
Some Windows APIs are removed | ❌ | ❌ |
Networking
Title | Binary compatible | Source compatible |
---|---|---|
AllowRenegotiation default is false | ❌ | ❌ |
Custom ping payloads on Linux | ❌ | ✔️ |
Socket.End methods don't throw ObjectDisposedException | ❌ | ✔️ |
SDK and MSBuild
Serialization
Title | Binary compatible | Source compatible |
---|---|---|
DataContractSerializer retains sign when deserializing -0 | ❌ | ✔️ |
Deserialize Version type with leading or trailing whitespace | ❌ | ✔️ |
JsonSerializerOptions copy constructor includes JsonSerializerContext | ❌ | ✔️ |
Polymorphic serialization for object types | ❌ | ✔️ |
System.Text.Json source generator fallback | ❌ | ✔️ |
Windows Forms
Title | Binary compatible | Source compatible |
---|---|---|
Obsoletions and warnings | ✔️ | ❌ |
Some APIs throw ArgumentNullException | ❌ | ✔️ |
WPF
Title | Binary compatible | Source compatible | Backwards compatible |
---|---|---|---|
Restored drag-and-drop operations behavior on text editors | ✔️ | ✔️ | ❌ |
XML and XSLT
Title | Binary compatible | Source compatible |
---|---|---|
XmlSecureResolver is obsolete | ❌ | ❌ |
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.