Loading...
Loading...
Compare original and translation side by side
net9.0net9.0TargetFrameworknet8.0net9.0BinaryFormatterTargetFrameworknet8.0net9.0BinaryFormatternet9.0net10.0migrate-dotnet9-to-dotnet10net9.0net10.0migrate-dotnet9-to-dotnet10| Input | Required | Description |
|---|---|---|
| Project or solution path | Yes | The |
| Build command | No | How to build (e.g., |
| Test command | No | How to run tests (e.g., |
| Project type hints | No | Whether the project uses ASP.NET Core, EF Core, WinForms, WPF, containers, etc. Auto-detect from PackageReferences and SDK attributes if not provided |
| 输入项 | 是否必填 | 描述 |
|---|---|---|
| 项目或解决方案路径 | 是 | 要迁移的 |
| 构建命令 | 否 | 构建方式(例如: |
| 测试命令 | 否 | 运行测试的方式(例如: |
| 项目类型提示 | 否 | 项目是否使用 ASP.NET Core、EF Core、WinForms、WPF、容器等。未提供时将通过 PackageReferences 和 SDK 属性自动检测 |
Answer directly from the loaded reference documents. Do not search the filesystem or fetch web pages for breaking change information — the references contain the authoritative details. Focus on identifying which breaking changes apply and providing concrete fixes.Commit strategy: Commit at each logical boundary — after updating the TFM (Step 2), after resolving build errors (Step 3), after addressing behavioral changes (Step 4), and after updating infrastructure (Step 5). This keeps each commit focused and reviewable.
直接从加载的参考文档中获取答案。请勿在文件系统中搜索或从网页获取重大变更信息——参考文档包含权威细节。重点识别哪些重大变更适用并提供具体修复方案。提交策略:在每个逻辑节点提交代码——更新 TFM(步骤2)后、解决构建错误(步骤3)后、处理行为变更(步骤4)后、更新基础设施(步骤5)后。这样可使每次提交的内容聚焦且便于评审。
.sln.slnx.csprojdotnet --versionMicrosoft.NET.Sdk.WebMicrosoft.NET.Sdk.WindowsDesktop<UseWPF><UseWindowsForms>Microsoft.EntityFrameworkCore.*Microsoft.Extensions.HttpBinaryFormatterSystem.Text.Jsondotnet build --no-incrementalbinobjnet8.0.sln.slnx.csprojdotnet --versionMicrosoft.NET.Sdk.WebMicrosoft.NET.Sdk.WindowsDesktop<UseWPF><UseWindowsForms>Microsoft.EntityFrameworkCore.*Microsoft.Extensions.HttpBinaryFormatterSystem.Text.Jsonnet8.0dotnet build --no-incrementalbinobj.csprojDirectory.Build.props<TargetFramework>net8.0</TargetFramework><TargetFramework>net9.0</TargetFramework>net9.0<TargetFrameworks>net8.0Microsoft.Extensions.*Microsoft.AspNetCore.*Microsoft.EntityFrameworkCore.*Directory.Packages.propsdotnet restorenet9.0net8.0.csprojDirectory.Build.props<TargetFramework>net8.0</TargetFramework><TargetFramework>net9.0</TargetFramework>net9.0<TargetFrameworks>net8.0Microsoft.Extensions.*Microsoft.AspNetCore.*Microsoft.EntityFrameworkCore.*Directory.Packages.propsdotnet restorenet9.0net8.0| If the project uses… | Load reference |
|---|---|
| Any .NET 9 project | |
| Any .NET 9 project | |
| Any .NET 9 project | |
| ASP.NET Core | |
| Entity Framework Core | |
| Cryptography APIs | |
| System.Text.Json, HttpClient, networking | |
| Windows Forms or WPF | |
| Docker containers, native interop | |
| Runtime configuration, deployment | |
paramsparams ReadOnlySpan<T>String.JoinString.ConcatPath.CombineTask.WhenAllExpressionreferences/core-libraries-dotnet8to9.mdStringValuesparams Span<T>StringValuesString.ConcatString.JoinPath.Combinereferences/core-libraries-dotnet8to9.mdSYSLIB0054Thread.VolatileReadVolatileWriteVolatile.ReadVolatile.WriteSYSLIB0057X509Certificate2X509CertificateX509CertificateLoaderSYSLIB0055SYSLIB0056references/core-libraries-dotnet8to9.mdInlineArray[InlineArray]record structstructreferences/csharp-compiler-dotnet8to9.mdunsafeunsafereferences/csharp-compiler-dotnet8to9.md[]references/csharp-compiler-dotnet8to9.mdString.Trim(params ReadOnlySpan<char>)ReadOnlySpan<char>TrimTrimStartTrimEndreferences/core-libraries-dotnet8to9.mdBinaryFormatterBinaryFormatterreferences/serialization-networking-dotnet8to9.mdHttpListenerRequest.UserAgentstring?references/serialization-networking-dotnet8to9.mdreferences/winforms-wpf-dotnet8to9.mdreferences/winforms-wpf-dotnet8to9.md| 如果项目使用… | 加载参考文档 |
|---|---|
| 任意 .NET 9 项目 | |
| 任意 .NET 9 项目 | |
| 任意 .NET 9 项目 | |
| ASP.NET Core | |
| Entity Framework Core | |
| 加密 API | |
| System.Text.Json、HttpClient、网络 | |
| Windows Forms 或 WPF | |
| Docker 容器、原生互操作 | |
| 运行时配置、部署 | |
paramsString.JoinString.ConcatPath.CombineTask.WhenAllparams ReadOnlySpan<T>Expressionreferences/core-libraries-dotnet8to9.mdStringValuesparams Span<T>String.ConcatString.JoinPath.CombineStringValuesreferences/core-libraries-dotnet8to9.mdSYSLIB0054Thread.VolatileReadVolatileWriteVolatile.ReadVolatile.WriteSYSLIB0057X509Certificate2X509CertificateX509CertificateLoaderSYSLIB0055SYSLIB0056Assembly.LoadFromreferences/core-libraries-dotnet8to9.mdInlineArrayrecord struct[InlineArray]structreferences/csharp-compiler-dotnet8to9.mdunsafeunsafereferences/csharp-compiler-dotnet8to9.md[]references/csharp-compiler-dotnet8to9.mdString.Trim(params ReadOnlySpan<char>)TrimTrimStartTrimEndReadOnlySpan<char>references/core-libraries-dotnet8to9.mdBinaryFormatterBinaryFormatterreferences/serialization-networking-dotnet8to9.mdHttpListenerRequest.UserAgentstring?references/serialization-networking-dotnet8to9.mdreferences/winforms-wpf-dotnet8to9.mdreferences/winforms-wpf-dotnet8to9.mdfloatdoublereferences/deployment-runtime-dotnet8to9.mdMigrate()MigrateAsync()DateTime.NowDateTime.UtcNowGuid.NewGuid()HasDatanew DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc)references/efcore-dotnet8to9.mdMigrate()references/efcore-dotnet8to9.mdSocketsHttpHandlerHttpClientHandlerInvalidCastExceptionreferences/serialization-networking-dotnet8to9.mdTracereferences/serialization-networking-dotnet8to9.mdruntimeconfig.jsonreferences/deployment-runtime-dotnet8to9.mdValidateOnBuildValidateScopesHostBuilderreferences/aspnet-core-dotnet8to9.mdFromKeyedServicesAttributeInvalidOperationExceptionBigInteger(2^31) - 1JsonDocumentnullJsonDocumentJsonValueKind.NullnullSystem.Text.JsonZipArchiveEntryIncrementingPollingCounterInMemoryDirectoryInfoRuntimeHelpers.GetSubArrayPictureBoxHttpRequestExceptionWebExceptionStatusStripIMsoComponentSafeEvpPKeyHandle.DuplicateHandleHttpClientserver.portdotnet watchGetXmlNamespaceMapsHashtableStringfloatdoublereferences/deployment-runtime-dotnet8to9.mdMigrate()MigrateAsync()HasDataDateTime.NowDateTime.UtcNowGuid.NewGuid()new DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc)references/efcore-dotnet8to9.mdMigrate()references/efcore-dotnet8to9.mdSocketsHttpHandlerHttpClientHandlerInvalidCastExceptionreferences/serialization-networking-dotnet8to9.mdTracereferences/serialization-networking-dotnet8to9.mdruntimeconfig.jsonreferences/deployment-runtime-dotnet8to9.mdValidateOnBuildValidateScopesHostBuilderreferences/aspnet-core-dotnet8to9.mdFromKeyedServicesAttributeInvalidOperationExceptionBigInteger(2^31) - 1JsonDocumentnullJsonDocumentJsonValueKind.NullnullSystem.Text.JsonZipArchiveEntryIncrementingPollingCounterInMemoryDirectoryInfoRuntimeHelpers.GetSubArrayPictureBoxHttpRequestExceptionWebExceptionStatusStripIMsoComponentSafeEvpPKeyHandle.DuplicateHandleHttpClientserver.portdotnet watchGetXmlNamespaceMapsHashtableStringRUN apt-get update && apt-get install -y zlib1g# Before
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/aspnet:8.0
# After
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
FROM mcr.microsoft.com/dotnet/aspnet:9.0global.json{
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature"
}
}rollForward"disable""latestPatch""latestFeature"net9.0net8.0dotnet build--tl:offMSBUILDTERMINALLOGGER=offdotnet workloadRUN apt-get update && apt-get install -y zlib1g# 之前
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/aspnet:8.0
# 之后
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
FROM mcr.microsoft.com/dotnet/aspnet:9.0global.json{
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature"
}
}rollForward"disable""latestPatch""latestFeature"net9.0net8.0dotnet build--tl:offMSBUILDTERMINALLOGGER=offdotnet workloaddotnet build --no-incrementaldotnet testdotnet build --no-incrementaldotnet testreferences/| Reference file | When to load |
|---|---|
| Always (C# 13 compiler breaking changes — InlineArray on records, iterator safe context, collection expression overloads) |
| Always (applies to all .NET 9 projects) |
| Always (SDK and build tooling changes) |
| Project uses ASP.NET Core |
| Project uses Entity Framework Core |
| Project uses System.Security.Cryptography or X.509 certificates |
| Project uses BinaryFormatter, System.Text.Json, HttpClient, or networking APIs |
| Project uses Windows Forms or WPF |
| Project uses Docker containers or native interop (P/Invoke) |
| Project uses runtime configuration, deployment, or has floating-point to integer conversions |
references/| 参考文件 | 加载时机 |
|---|---|
| 始终加载(C# 13 编译器重大变更——记录结构体上的 InlineArray、迭代器安全上下文、集合表达式重载) |
| 始终加载(适用于所有 .NET 9 项目) |
| 始终加载(SDK 和构建工具变更) |
| 项目使用 ASP.NET Core 时 |
| 项目使用 Entity Framework Core 时 |
| 项目使用 System.Security.Cryptography 或 X.509 证书时 |
| 项目使用 BinaryFormatter、System.Text.Json、HttpClient 或网络 API 时 |
| 项目使用 Windows Forms 或 WPF 时 |
| 项目使用 Docker 容器或原生互操作(P/Invoke)时 |
| 项目使用运行时配置、部署或存在浮点型转整型转换时 |