这样的标准上海市疫情防控工作领导小组也好意思发布出来?

人民日报林治波社长发出灵魂拷问:你们是没有常识,还是没有良知?

惨烈的高峰防御战—“圣元春战役”打响!

母子乱伦:和儿子做了,我该怎么办?

一定在信仰的指导下抗击疫情《马克思主义信仰:战胜新冠肺炎疫情的内生力量》

生成图片,分享到微信朋友圈

自由微信安卓APP发布,立即下载! | 提交文章网址
查看原文

.NET候选版本2发布

微软开发者MSDN 微软开发者MSDN 2022-10-19

点击上方蓝字

关注我们

(本文阅读时间:16分钟)

本文作者为Jon Douglas、Jeremy Likness 和 Angelos Petropoulos

今天,我们宣布推出 .NET 7 Release Candidate 2。这是 .NET 7 的最终候选版本(RC),并在生产环境中得到支持。

您可以下载适用于 Windows、macOS 和 Linux 的 .NET 7 Release Candidate 2。 
  • 安装程序和二进制文件
  • 容器图像
  • Linux 软件包
  • 发行说明
  • 已知的问题
  • GitHub 问题跟踪器
.NET 7 Release Candidate 2 已通过 Visual Studio 17.4 Preview 3 测试。如果您想在 Visual Studio 系列产品中试用 .NET 7,我们建议您使用预览通道构建。如果您使用的是 macOS,我们建议使用最新的 Visual Studio 2022 for Mac 预览版。
不要忘记 .NET Conf 2022。在 2022 年 11 月 8 日至 10 日与我们一起庆祝 .NET 7 的发布!
在本博客中,我们将重点介绍 .NET 7 的核心主题,并为您提供深入了解细节的资源。


  • .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 库在不断改进。会定期添加包含全新功能的新 API。现有 API 正在进行性能改进,只需升级即可使您受益。正在建造全新的库,以协助您完成日常工作。这些博客中介绍了许多 .NET 库增强功能,但不要忘记深入研究这些库:
  • .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 源生成重新启用反射回退


.NET 7 引入了一项有意义的重大更改,该更改删除了 System.Text.Json 源生成器中基于反射的序列化的静默回退。根据我们从客户那里收到的早期反馈,似乎有不少用户(大部分是偶然的)依赖回退行为。
即使已经记录了重大更改的解决方法,它仍然需要代码更改,这在某些情况下是不可能的。从 .NET 7 RC 2 开始,您可以使用提供的 AppContext 兼容性开关在全局范围内重新启用反射回退。将以下条目添加到应用程序的项目文件中,以重新启用应用程序中所有源构建上下文的反射回退:
<ItemGroup>  <RuntimeHostConfigurationOption Include="System.Text.Json.Serialization.EnableSourceGenReflectionFallback" Value="true" /></ItemGroup>
有关使用 AppContext 开关的详细信息,请参阅有关 .NET 运行时配置设置的文章。
  • 有意的重大更改:

    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
确保使用奇异递归模板模式 (CRTP) 的 .NET 通用数学接口在用户代码中正确实现。特别是,如果实现 .NET 通用数学接口(实现 CRTP 架构)的类型未使用类型本身填充泛型类型参数,它将发出警告。
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

▌防止内置运算符中的行为更改 IntPtr 和 UIntPtr

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 Hayward

用 Alan 自己的话说:

我是 Alan Hayward,我住在英国曼彻斯特郊外。
我对 .NET 及其生态系统还很陌生,但我在做编译之类的事情方面有着悠久的历史。在我职业生涯的早期,我曾在一家生产名为 QuickTransit 的 DBT 的初创公司工作——更好地称为 Apple 的 Rosetta(从他们从 PPC 迁移到 X86 时回来)——但我更关心它在架构中鲜为人知的应用程序:SPARC Solaris 到 X86/Itanium/PPC Linux 和 X86 Linux 到 MIPS/PPC/SPARC/Z Linux,可能还有更多的组合现在已经消失在时间的迷雾中。
2014 年,我加入了 Arm 的新曼彻斯特英国办事处,致力于为 GCC 和 GDB 添加 SVE 支持,然后成为 GDB 的 Arm/AArch64 维护者。今天我加入了 Arm 的运行时团队,研究流行的云和桌面运行时的性能和安全性。有一段时间我从事 OpenJDK 和 Graal 工作,包括添加对 Arm 的指针身份验证 (PAC) 安全功能的支持,以保护 OpenJDK 中的控制流。
我最近一直在与 .NET 上的一些团队合作——让我们加快速度,使用内在函数改进一些库例程,并为 Ryujit 添加一个 If Conversion pass。我很高兴看到我们可以对 Arm64 端口进行一些改进。
我喜欢 .NET 的哪些方面?我喜欢 C# 的简单性——您可以快速轻松地完成工作(每个会编程的人都可以用 C# 编程)。同样,Jit 本身在应用编译器技术的方式上也很直观。最后,对 SuperPMI 表示敬意——这是我希望在以前的项目中拥有的工具,能够快速获得测试套件之间的差异真是太棒了。
当我不工作时,经常会发现我用小画笔试图改善我的微型画,听太多的播客和有声读物。
我很高兴能成为其中的一员,非常感谢迄今为止与我互动过的社区中的人们,并希望随着时间的推移与更多人合作。
  • @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 Release Candidate 2 中包含的所有功能和改进的详细概述,请查看之前的 .NET 7 预览版博客文章:
  • 宣布发布 .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”博客,因为遗漏了一些令人兴奋的功能。
  • 宣布发布 .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~

文章有问题?点此查看未经处理的缓存