With the release of the first preview version, .NET 7 gradually surfaced. Jeremy Likness, senior project manager of .NET, introduced the main development direction of .NET 7 in the official blog. I will give you a brief introduction:

听说.NET 7来了,站长怎能不尝鲜呢,在除夕当天将体验情况简单汇报下。

一、.NET 7 详情(Proposed .NET 7 Breaking Changes #7131)

#7131 issure

https://github.com/dotnet/core/issues/7131

原文截图:

在线翻译截图:

二、.NET 7 SDK下载

安装信息描述见以下地址

https://github.com/dotnet/installer

Mac 下的SDK下载地址

https://aka.ms/dotnet/7.0.1xx/daily/dotnet-sdk-osx-x64.pkg

Windows X64 下的SDK下载地址

https://aka.ms/dotnet/7.0.1xx/daily/dotnet-sdk-win-x64.exe

三、尝鲜体验

3.1 安装.NET 7 SDK

站长使用 Windows 11开发,所以安装的 Windows X64 版本,简单放几张截图证明我装过,哈哈安装界面:

安装中界面:

安装完成:

3.2 Hello Word

创建 Blazor Server 空项目,运行内存占用情况( 28.3MB ),其他类型项目模板就不折腾了,各位自行尝试:

3.3 个人网站拥抱.NET 7

本站采用 ABP vNext + MASA Blazor 搭建,升级 .NET 7 及其他Nuget包后,无缝编译成功,现已成功上线运行:https://dotnet9.com。Dotnet9网站无缝编译成功:

网站运行情况:

网站使用 .NET 7 上线正常运行:

网站正在开发中,一直在优化,目前占用内存400MB左右,不着急,慢慢来。

四、 总结

至此网站拥抱 .NET 7 完美升级,至少到现在(2021-01-31 11:38)已经稳定运行快12个小时了。

 

.NET 7 builds on the foundation established by .NET 6, which includes a unified set of base libraries, runtime (runtime) and SDK, a simplified development experience and higher developer productivity, the main focus areas of .NET 7 include :

Improved support for cloud-native solutions
Tools to upgrade old projects
Make it easier for developers to use containers

Modern Client: .NET Multiplatform Application UI (.NET MAUI)

.NET MAUI is the future of .NET cross-platform native UI and will be part of .NET 7.

.NET MAUI Preview 13 was released on February 15th, and after .NET MAUI GA is released for .NET 6, it will be included in .NET 7 and continue to improve the development cycle experience, support the latest .NET SDK tools, update Fast application performance, shared code capabilities, and enhanced interoperability.

Interested brothers can check the status of .NET MAUI and the project roadmap for more information.
Modern Cloud: Cloud Native and Containers

.NET 7 will improve the developer experience: it will be easier for everyone to build cloud-native applications such as:

Simplifies setup and configuration required for secure authentication and authorization
Improve cloud-native application startup and runtime execution performance

At the same time, .NET 7 will continue to invest in cloud-native supporting tools, such as investing in the .NET cross-platform framework Orleans - a cross-platform framework for building distributed applications. Specific investments include continuing to enhance Orleans' comprehensive documentation and making Orleans easier to use and implement by improving its integration with existing cloud services such as Azure App Services and Azure Container Apps.

In addition, .NET 7 plans to bring significant improvements to .NET development using containers. E.g:

Explore "Building containers directly with MSBuild" as a new feature of the SDK
Enhanced telemetry planned to improve container observability
Focus on making container images smaller, faster, and more secure while exploring demanding models

Modernize: Upgrading .NET Applications

.NET .NET 7 continues to focus on enabling developers to upgrade existing .NET applications to the latest .NET platforms and technologies.

The .NET Upgrade Assistant includes more analyzers, code fixes, and upgrade support for more application types, making it easier for developers to upgrade a portfolio of .NET applications and less effort to upgrade applications.

In addition, .NET has a history of 20 years, and it has many applications, some of which are popular applications such as ASP.NET, WinForms, WPF, etc. Due to the rich documentation and tutorials, the modernization speed is relatively fast, and users can easily upgrade. However, some of these less popular projects, such as WCF (Windows Communication Foundation, a series of application frameworks developed by Microsoft to support data communication), may not have a clear modernization direction, and .NET will provide appropriate guidance and documentation for these unpopular applications. and tools to make these .NET application models easier to upgrade.
Targeting .NET 7

If you are targeting .NET 7 now, you will need to use the .NET 7 Target Framework Moniker (TFM) in your project files. E.g:

<TargetFramework>net7.0</TargetFramework>

Comes with a full suite of .NET 7 TFMs, including OS-specific TFMs.

net7.0
net7.0-android
net7.0-ios
net7.0-maccatalyst
net7.0-macos
net7.0-tvos
net7.0-windows

This makes it possible to test existing applications with .NET 7, and for now, upgrading from .NET 6 to .NET 7 is relatively easy.

随着第一个预览版发布,.NET 7 渐渐浮出水面,.NET 高级项目经理 Jeremy Likness 在官方博客中介绍了 .NET 7 的主要发展方向,俺整理给大伙做一下介绍:

.NET 7 建立在 .NET 6 建立的基础之上,其中包括一组统一的基础库、运行时(runtime)和 SDK、简化的开发体验和更高的开发人员生产力,.NET 7 主要关注领域包括:

改进对云原生方案的支持
升级旧项目的工具
简化开发人员使用容器的难度

现代客户端:.NET 多平台应用程序 UI (.NET MAUI)

.NET MAUI 是 .NET 跨平台原生 UI 的未来,将成为 .NET 7 的一部分。

2 月 15日 .NET MAUI Preview 13 发布,在 .NET MAUI GA 为 .NET 6 发布后,它将会被包含在 .NET 7 中,并持续改进开发循环体验、支持最新的 .NET SDK 工具、更快的应用程序性能、共享代码功能以及增强的互操作性。

感兴趣的兄弟可查看 .NET MAUI 的状态 和项目路线图,以获取更多信息。
现代云:云原生和容器

.NET 7 将改进开发人员体验:每个人都能更轻松地构建云原生应用程序,例如:

简化安全身份验证和授权所需的设置和配置
提高云原生应用程序启动和运行时的执行性能

于此同时,.NET 7 将持续投资云原生配套的工具,比如投资 .NET 跨平台框架 Orleans —— 一个构建分布式应用程序的跨平台框架。具体投资措施有:继续增强 Orleans 的综合文档,并通过改进 Orleans 与 Azure App Services 和 Azure Container Apps 等现有云服务的集成,使其更易于使用和实施。

此外, .NET 7 计划使用容器对 .NET 开发进行重大改进。例如:

探索将“通过 MSBuild 直接构建容器”作为 SDK 的一项新功能
计划增强遥测,以提高容器的可观察性
专注于使容器镜像更小、更快、更安全,同时探索高要求的模型

现代化:升级 .NET 应用程序

.NET .NET 7 继续致力于让开发者将现有的 .NET 应用程序升级到最新的 .NET 平台和技术。

.NET 升级助手包含更多分析器、代码修复程序,以及对更多应用程序类型的升级支持,可帮助开发者更轻松地升级 .NET 应用程序组合,减少升级应用的工作量。

此外,. NET 已有 20 年历史,它的应用程序非常多,其中一些热门应用比如 ASP.NET、WinForms、WPF 等,由于文档和教程较丰富,现代化的速度比较快,用户升级起来也轻松。但其中一些较冷门的项目,例如 WCF(Windows Communication Foundation,微软开发的一系列支持数据通信的应用程序框架),可能没有明确的现代化方向,.NET 将对这部分冷门应用提供适当的指导、文档和工具,以使这些 .NET 应用程序模型更易于升级。
面向 .NET 7

如果现在就要面向 .NET 7,则需要在项目文件中使用 .NET 7 Target Framework Moniker (TFM)。例如:

<TargetFramework>net7.0</TargetFramework>

附全套 .NET 7 TFM,包括特定操作系统的 TFM。

net7.0
net7.0-android
net7.0-ios
net7.0-maccatalyst
net7.0-macos
net7.0-tvos
net7.0-windows

如此便可以使用 .NET 7 测试现有的应用程序,目前来看,从 .NET 6 升级到 .NET 7 还是比较轻松的。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。