.NET候选版本2发布
点击上方蓝字
关注我们
(本文阅读时间:16分钟)
本文作者为Jon Douglas、Jeremy Likness 和 Angelos Petropoulos
今天,我们宣布推出 .NET 7 Release Candidate 2。这是 .NET 7 的最终候选版本(RC),并在生产环境中得到支持。
安装程序和二进制文件 容器图像 Linux 软件包 发行说明 已知的问题 GitHub 问题跟踪器
.NET 7 Release Candidate 2:
https://dotnet.microsoft.com/en-us/download/dotnet/7.0?ocid=AID3045631
安装程序和二进制文件:
https://dotnet.microsoft.com/download/dotnet/7.0
容器图像:
https://mcr.microsoft.com/catalog?search=dotnet/
Linux 软件包:
https://github.com/dotnet/core/blob/master/release-notes/7.0/
发行说明:
https://github.com/dotnet/core/tree/master/release-notes/7.0
已知的问题:
https://github.com/dotnet/core/blob/main/release-notes/7.0/known-issues.md
GitHub 问题跟踪器:
https://github.com/dotnet/core/issues
预览通道构建:
https://visualstudio.com/preview/?ocid=AID3045631
Visual Studio 2022 for Mac 预览版:
https://visualstudio.microsoft.com/vs/mac/preview/?ocid=AID3045631
.NET Conf 2022:
https://dotnetconf.net/
C# 11
C# 11 是 C# 的最新版本,现在可在 .NET 7 中使用。
我们在设计和开发 C# 中。您可以加入我们的 CSharpLang 存储库以查看最新的 C# 功能提案和会议记录。计划工作后,您可以通过我们的功能状态页面监控进度。要了解有关 C# 11 的更多信息,请查看以下内容:
C# 11 功能的早期预览
https://devblogs.microsoft.com/dotnet/early-peek-at-csharp-11-features/?ocid=AID3045631
C# 11 预览更新 - 原始字符串文字、UTF-8 等
https://devblogs.microsoft.com/dotnet/csharp-11-preview-updates/?ocid=AID3045631
C# 11 预览:通用数学、必需成员等
https://devblogs.microsoft.com/dotnet/csharp-11-preview-august-update/?ocid=AID3045631
C# 11 中的新功能
https://learn.microsoft.com/zh-cn/dotnet/csharp/whats-new/csharp-11?ocid=AID3045631
注意:若要试用 C# 11 预览版功能,请创建一个 C# 项目并将 LangVersion 设置为 Preview。
CSharpLang 存储库:
https://github.com/dotnet/csharplang
功能状态页面:
https://github.com/dotnet/roslyn/blob/main/docs/Language Feature Status.md
将 LangVersion 设置为 Preview:
https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/language#langversion?ocid=AID3045631
库
.NET 6 中的预览功能 - 通用数学
https://devblogs.microsoft.com/dotnet/preview-features-in-net-6-generic-math/?ocid=AID3045631
.NET 7 Preview 5 – 通用数学
https://devblogs.microsoft.com/dotnet/dotnet-7-generic-math/?ocid=AID3045631
.NET 7 中的正则表达式改进
https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/?ocid=AID3045631
宣布推出 .NET 的速率限制
https://devblogs.microsoft.com/dotnet/announcing-rate-limiting-for-dotnet/?ocid=AID3045631
SDK
每个 .NET 版本都包含对 .NET SDK 的大量改进,包括用于创建、生成和管理 .NET 项目的核心功能。许多增强功能已包含在您可以阅读的以前的预览博客中。要了解有关新 SDK 功能的更多信息,请参阅以下内容:
宣布推出对 .NET SDK的内置容器支持
https://devblogs.microsoft.com/dotnet/announcing-builtin-container-support-for-the-dotnet-sdk/?ocid=AID3045631
中央包管理简介
https://devblogs.microsoft.com/nuget/introducing-central-package-management/?ocid=AID3045631
如何为 System.Text.Json 源生成重新启用反射回退
<ItemGroup><RuntimeHostConfigurationOptionInclude="System.Text.Json.Serialization.EnableSourceGenReflectionFallback"Value="true" /></ItemGroup>
有意的重大更改:
https://learn.microsoft.com/dotnet/core/compatibility/serialization/7.0/reflection-fallback?ocid=AID3045631
.NET 运行时配置设置:
https://learn.microsoft.com/dotnet/core/runtime-config/?ocid=AID3045631
新分析器用于帮助您以正确方式使用 API
dotnet/runtime #69775
https://github.com/dotnet/runtime/issues/69775
public readonly struct DateOnly : IParsable<DateOnly> // correct implementation of IParsable<TSelf> interface{ ... }public readonly struct MyDate : IParsable<DateOnly> // Warns: "The 'IParsable<TSelf>' requires the 'TSelf' type parameter to be filled with the derived type 'MyDate' " the type parameter TSelf{ ... }
奇异递归模板模式: https://wikipedia.org/wiki/Curiously_recurring_template_pattern
dotnet/runtime #74022
https://github.com/dotnet/runtime/issues/74022
.NET 7 中为 System.IntPtr 和 System.UIntPtr 添加的一些内置运算符的行为与 .NET 6 及更低版本中用户定义的运算符不同。一些过去在溢出时抛出未经检查的上下文的运算符现在不再抛出,除非被包装在检查的上下文中,而一些以前不用于在检查的上下文中抛出的运算符现在会在溢出时抛出,除非被包装在未经检查的上下文中。分析器检测可能导致这些行为变化的代码并通知它。
例如:
checked{intPtr2 = intPtr1 + 2; // Warns: "Starting with .NET 7 the operator '+' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."intPtr2 = intPtr1 - 2; // Warns: "Starting with .NET 7 the operator '-' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."void* ptr = (void*)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(void*)IntPtr' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."intPtr2 = (IntPtr)ptr; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)void*' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."}intPtr1 = (IntPtr)longValue; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)Int64' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."int a = (int)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(Int32)IntPtr' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."
贡献者聚光灯
非常感谢我们所有的社区成员。我们非常感谢您的周到贡献。我们请贡献者@a74nh 分享他的想法。
用 Alan 自己的话说:
@a74nh:
https://github.com/a74nh
支持
.NET 7 发布时提供标准支持。尽管这是以前称为“当前”的新名称,但支持持续时间没有改变。奇数 .NET 版本发布时提供18个月的标准支持。长期支持(LTS)的名称或期限没有变化,仍持续36个月。有关更多详细信息,请参阅我们的 .NET 和 .NET Core 支持生命周期文档。
.NET 和 .NET Core 支持生命周期: https://dotnet.microsoft.com/platform/support/policy/dotnet-core
路线图
.NET 版本包括代表 Microsoft 内部和外部多个团队之间协作的产品、库、运行时和工具。您可以通过阅读产品路线图了解有关这些领域的更多信息:
ASP.NET Core 7 and Blazor Roadmap
https://github.com/dotnet/aspnetcore/issues/39504
EF 7 Roadmap
https://docs.microsoft.com/ef/core/what-is-new/ef-core-7.0/plan
ML.NET
https://github.com/dotnet/machinelearning/blob/main/ROADMAP.md
.NET MAUI
https://github.com/dotnet/maui/wiki/Roadmap
WinForms
https://github.com/dotnet/winforms/blob/main/docs/roadmap.md
WPF
https://github.com/dotnet/wpf/blob/main/roadmap.md
NuGet
https://github.com/NuGet/Home/issues/11571
Roslyn
https://github.com/dotnet/roslyn/blob/main/docs/Language Feature Status.md
Runtime
https://github.com/dotnet/core/blob/main/roadmap.md
我们感谢您对 .NET 的所有支持和贡献。请尝试使用 .NET 7 Release Candidate 2,并告诉我们您的想法!
感谢: https://dotnet.microsoft.com/thanks .NET 7 Release Candidate 2: https://dotnet.microsoft.com/download/dotnet/7.0
宣布发布 .NET 7 预览版 1
https://devblogs.microsoft.com/dotnet/announcing-net-7-preview-1/?ocid=AID3045631
宣布发布 .NET 7 预览版 2
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-2/?ocid=AID3045631
宣布发布 .NET 7 预览版 3
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-3/?ocid=AID3045631
宣布发布 .NET 7 预览版 4
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-4/?ocid=AID3045631
宣布发布 .NET 7 预览版 5
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-5/?ocid=AID3045631
宣布发布 .NET 7 预览版 6
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-6/?ocid=AID3045631
宣布发布 .NET 7 预览版 7
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-7/?ocid=AID3045631
宣布发布 .NET 7 候选版本 1
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-rc-1/?ocid=AID3045631
宣布发布 .NET 7 Release Candidate 1:
https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-rc-1/?ocid=AID3045631
扫码试用 .NET 7 Release Candidate 2
长按识别二维码
点击「阅读原文」试用 .NET 7 Release Candidate 2~