内容简介:.NET Core 3.0 Preview 6 已发布,其中包括用于编译程序集的更新,以改进启动性能,以及通过对链接器和 EventPipe 的改进来优化应用程序的大小。 此外,.NET Core 团队还为 Alpine on ARM64 发布了新的 Docker 镜...
.NET Core 3.0 Preview 6 已发布,其中包括用于编译程序集的更新,以改进启动性能,以及通过对链接器和 EventPipe 的改进来优化应用程序的大小。
此外,.NET Core 团队还为 Alpine on ARM64 发布了新的 Docker 镜像。
下载地址:https://dotnet.microsoft.com/download/dotnet-core/3.0(支持 Windows, macOS 和 Linux)
WPF 和 Windows Forms 更新
WPF 团队现已将大部分的 WPF 代码库托管至 GitHub。实际上,他们刚刚发布了 15 个组件的源代码。对于熟悉 WPF 的开发者来说,这些程序集名称应该非常熟悉。
Alpine Docker 镜像
Docker 镜像现在可用于 ARM64 上的 .NET Core 和 ASP.NET Core,它们之前只适用于 x64 平台。
以下的镜像可用于Dockerfile, 如下所示使用docker pull 的方式即可:
docker pull mcr.microsoft.com/dotnet/core/runtime:3.0-alpine-arm64v8docker pull mcr.microsoft.com/dotnet/core/aspnet:3.0-alpine-arm64v8
在 HttpClient 中提供对 HTTP/2 的支持
HTTP/2 是 HTTP 协议的主要修订版。.NET Core 3.0 的HttpClient 中现已添加对 HTTP/2 请求的支持。虽然默认值仍为 HTTP/1.1,但我们可以通过在 HTTP 请求消息上设置版本来选择使用 HTTP/2。
var client = new HttpClient() { BaseAddress = new Uri("https://localhost:5001") };
// HTTP/1.1 request
using (var response = await client.GetAsync("/"))
{
Console.WriteLine(response.Content);
}
// HTTP/2 request
using (var request = new HttpRequestMessage(HttpMethod.Get, "/") { Version = new Version(2, 0) })
using (var response = await client.SendAsync(request))
{
Console.WriteLine(response.Content);
}
或者可以通过设置DefaultRequestVersion属性以在HttpClient中默认发送 HTTP/2 请求。
var client = new HttpClient()
{
BaseAddress = new Uri("https://localhost:5001"),
DefaultRequestVersion = new Version(2, 0)
};
// Defaults to HTTP/2
using (var response = await client.GetAsync("/"))
{
Console.WriteLine(response.Content);
}
其他更新还包括对事件管道的改进、使用 ReadyToRun 镜像优化 .NET Core 应用程序以及针对跨平台/跨架构编译的改进。详情请查看发布公告。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Types and Programming Languages
Benjamin C. Pierce / The MIT Press / 2002-2-1 / USD 95.00
A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of typ......一起来看看 《Types and Programming Languages》 这本书的介绍吧!