SlideShare a Scribd company logo
ASP.NET Core 6.0 全新功能探索
多奇數位創意有限公司
技術總監 黃保翕(Will 保哥)
Visual Studio 2022
ASP.NET Core 專案範本
3
• ASP.NET Core Empty (New routing APIs)
• ASP.NET Core Web App (Razor Page)
• ASP.NET Core Web App (Model-View-Controller)
• ASP.NET Core Web API (New routing APIs)
• ASP.NET Core gRPC Service
• ASP.NET Core with Angular
• ASP.NET Core with React.js
• ASP.NET Core with React.js and Redux
• Blazor WebAssembly App
• Blazor Server App
ASP.NET Core 6 啟動時自動信任 SSL 憑證
4
ASP.NET Core 6 啟動時預設使用 Kestrel
5
• 過去都是以 IIS Express 為主要的啟動設定檔 (Launch Profile)
• 按下 Ctrl+F5 啟動應用程式不會看到 Console 視窗跳出來
• Visual Studio 2022 RTM (17.0.0) 有許多 Bugs 已在 17.0.1 修復
專案範本預設不使用 5000, 5001 通訊埠
• 使用專案範本建立 ASP.NET Core 專案會自動配發一個亂數的 Ports
• HTTP Port 範圍從 5000 到 5300
• HTTPS Port 範圍從 7000 到 7300
• 設定將儲存於 Properties/launchSettings.json 檔案中
專案範本的 Logging 設定區段變更
• 預設所有 LogLevel 設定在 Information 等級
• 只有 Microsoft.AspNetCore 設定在 Warning 等級
ASP.NET Core 6 內建的分析器
• Code analysis in ASP.NET Core apps
• Overview of .NET source code analysis
Hot Reload
熱重載支援 (Hot Reload support)
• Visual Studio 2022
• 預設啟用 Hot Reload 功能
• .NET CLI
• dotnet watch
• dotnet watch --no-hot-reload
• 按下 Ctrl+R 可以重新啟動應用程式
10
ASP.NET Core Web App (Model-View-Controller)
• ASP.NET Core 6.0 移除 Enable Razor runtime compilation 選項
11
MVC 不要使用 ViewBag 語法
• 啟用 Hot Reload 的執行環境下,任何 ViewBag 變更會導致網站掛掉
12
Minimal APIs
ASP.NET Core Web API
• 專案範本提供 Use controllers (uncheck to use minimal APIs) 選項
14
關於 minimal APIs 包含的內容
• Minimal APIs overview
• New hosting APIs
• WebApplication and WebApplicationBuilder
• New routing APIs
15
全新的 Hosting APIs
• WebApplication
• Properties
• Configuration
• Environment
• Lifetime
• Logger
• Services
• Urls
• Methods
• Create(args)
• Run(url)
• WebApplicationBuilder
• Properties
• Configuration
• Environment
• Host
• Logging
• Services
• WebHost
• Methods
• Build()
16
SPA
Microsoft.AspNetCore.SpaProxy
ASP.NET Core with Angular
• 內建 ASP.NET Core 搭載 Angular 12 的專案範本
• 預設擁有完美的 MSBuild 專案設定
• Build (F6) 會自動包含 npm install 命令
• Publish 會自動執行 ng build -- --prod (可調整)
• dotnet publish 就可以完成發行作業!
• 簡潔的 MapFallbackToFile 用來支援 SPA 運作
app.MapFallbackToFile("index.html");
19
C# 10
Top-level statements
• ASP.NET Core 6.0 Minimal APIs 的基礎
• 大幅簡化 ASP.NET Core 初始化的過程
ASP.NET Core 6.0 啟用了以下 C# 語言特性
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
22
可空值的參考型別 (Nullable reference types)
• 為了避免 System.NullReferenceException 例外再次出現!
• 宣告此屬性允許空值
• string? name;
• 斷言屬性不會有空值
• name!.Length
• Nullable reference migations
23
Nullable reference types
• 為了避免 System.NullReferenceException 例外再次出現!
• student.MiddleName?.ToUpper()
• 標示語法
• name!.Length
• string? name;
24
Attributes for null-state analysis
• 回傳型別允許空值
• T? 或 [MaybeNull]T
• 傳入參數允許空值
• T? 或 [AllowNull]T
25
隱含引用命名空間
• 啟用隱含引用命名空間 ( *.csproj )
<ImplicitUsings>enable</ImplicitUsings>
• 全域引用 ( *.csproj )
MSBuild properties for Microsoft.NET.Sdk - .NET | Microsoft Docs
<Using Include="WebApplication1.Data"/>
• 全域引用 ( *.cs )
global using global::SomeNamespace;
26
ASP.NET Core 6.0 核心變更
開發環境下使用 minimal hosting model 宣告
• 預設載入 DeveloperExceptionPageMiddleware
• 避免使用 DeveloperExceptionPageMiddleware 的方法
1. 改用 generic host model (Startup.cs)
2. 自訂一個 Middleware 攔截所有例外
3. 不要用 Development 環境
28
View Components 的 Tag Helpers 預設參數
• View Component
class MyViewComponent
{
IViewComponentResult Invoke(bool showSomething = false) { ... }
}
• Razor / Views
<vc:my />
29
app.UseHttpLogging();
• 新的 HTTP logging middleware 可完整記錄 HTTP 要求/回應內容
• 記錄類別
• Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware
30
Shadow copying in IIS
• 新版 ASP.NET Core Module (ANCM) 支援陰影複製功能
• 如何啟用 ASP.NET Core 6 部署到 IIS 的陰影複製 (Shadow-copying) 功能
31
Razor 編譯器
• 改用 Source Generators 編譯,執行效能大幅提昇!
• 不再產生額外的 *.Views.dll 組件 (assembly)
32
支援 IAsyncDisposable 介面實作
• IAsyncDisposable supported
• 支援 Controllers、Razor Pages 與 View Components 實作此介面
33
Kestrel 支援 HTTP/3 預覽
• Use HTTP/3 with the ASP.NET Core Kestrel web server
• HTTP/3 support in .NET 6
34
內建認證伺服器 (Authentication servers)
• .NET 3 到 .NET 5 專案範本使用 IdentityServer4
• .NET 6 專案範本支援 Duende Identity Server
• 升級
• 命名空間 IdentityServer4.IdentityServer 改成 Duende.IdentityServer
• Upgrading :: Duende IdentityServer Documentation
35
一堆肉眼看不見的變更
• ASP.NET Core performance and API improvements
• Reduced memory footprint for idle TLS connections
• Reduce the size of System.IO.Pipelines.Pipe
• Pool SocketSender
• Zero bytes reads with SslStream
• Zero byte reads with PipeReader
• Remove slabs from the SlabMemoryPool
36
Thanks for joining!
相關連結
• 體驗全新 ASP.NET Core 6.0 專案範本與 C# 10 語言特性 (文章)
• 深入 ASP․NET Core 6.0 專案範本的各種技術細節 (直播錄影)
• Breaking changes in .NET 6
• Migrate from ASP.NET Core 5.0 to 6.0
38

More Related Content

What's hot (20)

PDF
Building the Game Server both API and Realtime via c#
Yoshifumi Kawai
 
PDF
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg
 
PPTX
大規模データ処理の定番OSS Hadoop / Spark 最新動向 - 2021秋 -(db tech showcase 2021 / ONLINE 発...
NTT DATA Technology & Innovation
 
PDF
AWS Aurora 운영사례 (by 배은미)
I Goo Lee.
 
PDF
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
崇之 清水
 
PDF
Apache Spark の紹介(前半:Sparkのキホン)
NTT DATA OSS Professional Services
 
PDF
Apache Sparkに手を出してヤケドしないための基本 ~「Apache Spark入門より」~ (デブサミ 2016 講演資料)
NTT DATA OSS Professional Services
 
PDF
[오픈소스컨설팅]Java Performance Tuning
Ji-Woong Choi
 
PDF
Twitter의 snowflake 소개 및 활용
흥배 최
 
PDF
Grafana LokiではじめるKubernetesロギングハンズオン(NTT Tech Conference #4 ハンズオン資料)
NTT DATA Technology & Innovation
 
PPTX
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
PDF
[232] 성능어디까지쥐어짜봤니 송태웅
NAVER D2
 
PDF
AWS Black Belt Online Seminar AWS上のJenkins活用方法
Amazon Web Services Japan
 
PDF
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon
 
PDF
Cassandra Introduction & Features
DataStax Academy
 
PDF
MySQLと組み合わせて始める全文検索プロダクト"elasticsearch"
Kentaro Yoshida
 
PDF
AWS Wavelengthと大阪リージョンのご紹介20210414
Amazon Web Services Japan
 
PPTX
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
Ohyama Masanori
 
PPTX
Java11へのマイグレーションガイド ~Apache Hadoopの事例~
Yahoo!デベロッパーネットワーク
 
PDF
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi
 
Building the Game Server both API and Realtime via c#
Yoshifumi Kawai
 
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg
 
大規模データ処理の定番OSS Hadoop / Spark 最新動向 - 2021秋 -(db tech showcase 2021 / ONLINE 発...
NTT DATA Technology & Innovation
 
AWS Aurora 운영사례 (by 배은미)
I Goo Lee.
 
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
崇之 清水
 
Apache Spark の紹介(前半:Sparkのキホン)
NTT DATA OSS Professional Services
 
Apache Sparkに手を出してヤケドしないための基本 ~「Apache Spark入門より」~ (デブサミ 2016 講演資料)
NTT DATA OSS Professional Services
 
[오픈소스컨설팅]Java Performance Tuning
Ji-Woong Choi
 
Twitter의 snowflake 소개 및 활용
흥배 최
 
Grafana LokiではじめるKubernetesロギングハンズオン(NTT Tech Conference #4 ハンズオン資料)
NTT DATA Technology & Innovation
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
[232] 성능어디까지쥐어짜봤니 송태웅
NAVER D2
 
AWS Black Belt Online Seminar AWS上のJenkins活用方法
Amazon Web Services Japan
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon
 
Cassandra Introduction & Features
DataStax Academy
 
MySQLと組み合わせて始める全文検索プロダクト"elasticsearch"
Kentaro Yoshida
 
AWS Wavelengthと大阪リージョンのご紹介20210414
Amazon Web Services Japan
 
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
Ohyama Masanori
 
Java11へのマイグレーションガイド ~Apache Hadoopの事例~
Yahoo!デベロッパーネットワーク
 
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
Ji-Woong Choi
 

Similar to ASP.NET Core 6.0 全新功能探索 (20)

PPTX
ASP.NET MVC 6 新功能探索
Will Huang
 
PPTX
使用 ASP.NET 5 實戰開發雲端應用程式
Will Huang
 
PPTX
DEV305 - ASP.NET 5 開發攻略
Will Huang
 
PPTX
Asp.net mvc 6 新功能初探
Gelis Wu
 
PPTX
ASP.NET Core 3.0 新功能
Edward Kuo
 
PPTX
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
Will Huang
 
PDF
Asp.net mvc網站的從無到有
Wade Huang
 
PDF
ASP.NET Core 2.1設計新思維與新發展
江華 奚
 
PDF
ASP.Net MVC2 简介
Allen Lsy
 
PPTX
Angular 7 全新功能探索 (Angular Taiwan 2018)
Will Huang
 
PPTX
[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛
Edward Kuo
 
PPTX
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC
 
PDF
Nodejs & NAE
q3boy
 
PPTX
ASP.NET 5 快速入門 (Getting Started ASP.NET 5)
Jeff Chu
 
PDF
Top100summit automan x之框架介绍 王超
drewz lin
 
PPTX
Asp.net 5 新功能與變革
Gelis Wu
 
PPTX
ASP.NET 開發人員不可不知的 IIS (IIS for ASP.NET Developers)
Jeff Chu
 
PDF
Berserk js
taobao.com
 
PDF
KISSY Editor Design 2
yiming he
 
PPTX
從頭打造 C#、.NET 與 ASP.NET Core 開發環境
Will Huang
 
ASP.NET MVC 6 新功能探索
Will Huang
 
使用 ASP.NET 5 實戰開發雲端應用程式
Will Huang
 
DEV305 - ASP.NET 5 開發攻略
Will Huang
 
Asp.net mvc 6 新功能初探
Gelis Wu
 
ASP.NET Core 3.0 新功能
Edward Kuo
 
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
Will Huang
 
Asp.net mvc網站的從無到有
Wade Huang
 
ASP.NET Core 2.1設計新思維與新發展
江華 奚
 
ASP.Net MVC2 简介
Allen Lsy
 
Angular 7 全新功能探索 (Angular Taiwan 2018)
Will Huang
 
[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛
Edward Kuo
 
twMVC#01 | ASP.NET MVC 的第一次親密接觸
twMVC
 
Nodejs & NAE
q3boy
 
ASP.NET 5 快速入門 (Getting Started ASP.NET 5)
Jeff Chu
 
Top100summit automan x之框架介绍 王超
drewz lin
 
Asp.net 5 新功能與變革
Gelis Wu
 
ASP.NET 開發人員不可不知的 IIS (IIS for ASP.NET Developers)
Jeff Chu
 
Berserk js
taobao.com
 
KISSY Editor Design 2
yiming he
 
從頭打造 C#、.NET 與 ASP.NET Core 開發環境
Will Huang
 
Ad

More from Will Huang (20)

PPTX
深入理解 CVE-2022-24765 漏洞的攻擊與防護策略 (Git v2.35.2)
Will Huang
 
PPTX
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
Will Huang
 
PPTX
你一定不能不知道的 Markdown 寫作技巧
Will Huang
 
PPTX
使用 .NET 5 實現美股期貨的量化交易策略 (.NET Conf 2020)
Will Huang
 
PPTX
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
Will Huang
 
PPTX
Micro-frontends with Angular 10 (Modern Web 2020)
Will Huang
 
PPTX
從實戰經驗看到的 K8S 導入痛點
Will Huang
 
PPTX
RxJS 6 新手入門
Will Huang
 
PPTX
极速 Angular 开发:效能调校技巧 (ngChina 2019)
Will Huang
 
PPTX
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
Will Huang
 
PPTX
Protractor: The Hacker way (NG-MY 2019)
Will Huang
 
PPTX
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
Will Huang
 
PPTX
Angular 开发技巧 (2018 ngChina 开发者大会)
Will Huang
 
PPTX
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
Will Huang
 
PPTX
AKS 與開發人員體驗 (Kubernetes 大講堂)
Will Huang
 
PPTX
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
Will Huang
 
PPTX
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
Will Huang
 
PPTX
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
Will Huang
 
PPTX
以敏捷架構打造美國軟體外包專案的經驗談
Will Huang
 
PPTX
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
Will Huang
 
深入理解 CVE-2022-24765 漏洞的攻擊與防護策略 (Git v2.35.2)
Will Huang
 
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
Will Huang
 
你一定不能不知道的 Markdown 寫作技巧
Will Huang
 
使用 .NET 5 實現美股期貨的量化交易策略 (.NET Conf 2020)
Will Huang
 
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
Will Huang
 
Micro-frontends with Angular 10 (Modern Web 2020)
Will Huang
 
從實戰經驗看到的 K8S 導入痛點
Will Huang
 
RxJS 6 新手入門
Will Huang
 
极速 Angular 开发:效能调校技巧 (ngChina 2019)
Will Huang
 
你不可不知的 ASP.NET Core 3 全新功能探索 (.NET Conf 2019)
Will Huang
 
Protractor: The Hacker way (NG-MY 2019)
Will Huang
 
邁向 Windows Server 應用程式現代化 (Windows Server Application Modernization)
Will Huang
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Will Huang
 
利用.NET Core 與 Azure Kubernetes Service (AKS) 建立高彈性 Microservices (Azure TechDay)
Will Huang
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
Will Huang
 
使用 ASP.NET Blazor 開發 SPA 網頁應用程式 (.NET Conf 2018)
Will Huang
 
全新 Windows Server 2019 容器技術 及邁向與 Kubernetes 整合之路 (Windows Server 高峰會)
Will Huang
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
Will Huang
 
以敏捷架構打造美國軟體外包專案的經驗談
Will Huang
 
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
Will Huang
 
Ad

ASP.NET Core 6.0 全新功能探索

  • 1. ASP.NET Core 6.0 全新功能探索 多奇數位創意有限公司 技術總監 黃保翕(Will 保哥)
  • 3. ASP.NET Core 專案範本 3 • ASP.NET Core Empty (New routing APIs) • ASP.NET Core Web App (Razor Page) • ASP.NET Core Web App (Model-View-Controller) • ASP.NET Core Web API (New routing APIs) • ASP.NET Core gRPC Service • ASP.NET Core with Angular • ASP.NET Core with React.js • ASP.NET Core with React.js and Redux • Blazor WebAssembly App • Blazor Server App
  • 4. ASP.NET Core 6 啟動時自動信任 SSL 憑證 4
  • 5. ASP.NET Core 6 啟動時預設使用 Kestrel 5 • 過去都是以 IIS Express 為主要的啟動設定檔 (Launch Profile) • 按下 Ctrl+F5 啟動應用程式不會看到 Console 視窗跳出來 • Visual Studio 2022 RTM (17.0.0) 有許多 Bugs 已在 17.0.1 修復
  • 6. 專案範本預設不使用 5000, 5001 通訊埠 • 使用專案範本建立 ASP.NET Core 專案會自動配發一個亂數的 Ports • HTTP Port 範圍從 5000 到 5300 • HTTPS Port 範圍從 7000 到 7300 • 設定將儲存於 Properties/launchSettings.json 檔案中
  • 7. 專案範本的 Logging 設定區段變更 • 預設所有 LogLevel 設定在 Information 等級 • 只有 Microsoft.AspNetCore 設定在 Warning 等級
  • 8. ASP.NET Core 6 內建的分析器 • Code analysis in ASP.NET Core apps • Overview of .NET source code analysis
  • 10. 熱重載支援 (Hot Reload support) • Visual Studio 2022 • 預設啟用 Hot Reload 功能 • .NET CLI • dotnet watch • dotnet watch --no-hot-reload • 按下 Ctrl+R 可以重新啟動應用程式 10
  • 11. ASP.NET Core Web App (Model-View-Controller) • ASP.NET Core 6.0 移除 Enable Razor runtime compilation 選項 11
  • 12. MVC 不要使用 ViewBag 語法 • 啟用 Hot Reload 的執行環境下,任何 ViewBag 變更會導致網站掛掉 12
  • 14. ASP.NET Core Web API • 專案範本提供 Use controllers (uncheck to use minimal APIs) 選項 14
  • 15. 關於 minimal APIs 包含的內容 • Minimal APIs overview • New hosting APIs • WebApplication and WebApplicationBuilder • New routing APIs 15
  • 16. 全新的 Hosting APIs • WebApplication • Properties • Configuration • Environment • Lifetime • Logger • Services • Urls • Methods • Create(args) • Run(url) • WebApplicationBuilder • Properties • Configuration • Environment • Host • Logging • Services • WebHost • Methods • Build() 16
  • 17. SPA
  • 19. ASP.NET Core with Angular • 內建 ASP.NET Core 搭載 Angular 12 的專案範本 • 預設擁有完美的 MSBuild 專案設定 • Build (F6) 會自動包含 npm install 命令 • Publish 會自動執行 ng build -- --prod (可調整) • dotnet publish 就可以完成發行作業! • 簡潔的 MapFallbackToFile 用來支援 SPA 運作 app.MapFallbackToFile("index.html"); 19
  • 20. C# 10
  • 21. Top-level statements • ASP.NET Core 6.0 Minimal APIs 的基礎 • 大幅簡化 ASP.NET Core 初始化的過程
  • 22. ASP.NET Core 6.0 啟用了以下 C# 語言特性 <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> </Project> 22
  • 23. 可空值的參考型別 (Nullable reference types) • 為了避免 System.NullReferenceException 例外再次出現! • 宣告此屬性允許空值 • string? name; • 斷言屬性不會有空值 • name!.Length • Nullable reference migations 23
  • 24. Nullable reference types • 為了避免 System.NullReferenceException 例外再次出現! • student.MiddleName?.ToUpper() • 標示語法 • name!.Length • string? name; 24
  • 25. Attributes for null-state analysis • 回傳型別允許空值 • T? 或 [MaybeNull]T • 傳入參數允許空值 • T? 或 [AllowNull]T 25
  • 26. 隱含引用命名空間 • 啟用隱含引用命名空間 ( *.csproj ) <ImplicitUsings>enable</ImplicitUsings> • 全域引用 ( *.csproj ) MSBuild properties for Microsoft.NET.Sdk - .NET | Microsoft Docs <Using Include="WebApplication1.Data"/> • 全域引用 ( *.cs ) global using global::SomeNamespace; 26
  • 27. ASP.NET Core 6.0 核心變更
  • 28. 開發環境下使用 minimal hosting model 宣告 • 預設載入 DeveloperExceptionPageMiddleware • 避免使用 DeveloperExceptionPageMiddleware 的方法 1. 改用 generic host model (Startup.cs) 2. 自訂一個 Middleware 攔截所有例外 3. 不要用 Development 環境 28
  • 29. View Components 的 Tag Helpers 預設參數 • View Component class MyViewComponent { IViewComponentResult Invoke(bool showSomething = false) { ... } } • Razor / Views <vc:my /> 29
  • 30. app.UseHttpLogging(); • 新的 HTTP logging middleware 可完整記錄 HTTP 要求/回應內容 • 記錄類別 • Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware 30
  • 31. Shadow copying in IIS • 新版 ASP.NET Core Module (ANCM) 支援陰影複製功能 • 如何啟用 ASP.NET Core 6 部署到 IIS 的陰影複製 (Shadow-copying) 功能 31
  • 32. Razor 編譯器 • 改用 Source Generators 編譯,執行效能大幅提昇! • 不再產生額外的 *.Views.dll 組件 (assembly) 32
  • 33. 支援 IAsyncDisposable 介面實作 • IAsyncDisposable supported • 支援 Controllers、Razor Pages 與 View Components 實作此介面 33
  • 34. Kestrel 支援 HTTP/3 預覽 • Use HTTP/3 with the ASP.NET Core Kestrel web server • HTTP/3 support in .NET 6 34
  • 35. 內建認證伺服器 (Authentication servers) • .NET 3 到 .NET 5 專案範本使用 IdentityServer4 • .NET 6 專案範本支援 Duende Identity Server • 升級 • 命名空間 IdentityServer4.IdentityServer 改成 Duende.IdentityServer • Upgrading :: Duende IdentityServer Documentation 35
  • 36. 一堆肉眼看不見的變更 • ASP.NET Core performance and API improvements • Reduced memory footprint for idle TLS connections • Reduce the size of System.IO.Pipelines.Pipe • Pool SocketSender • Zero bytes reads with SslStream • Zero byte reads with PipeReader • Remove slabs from the SlabMemoryPool 36
  • 38. 相關連結 • 體驗全新 ASP.NET Core 6.0 專案範本與 C# 10 語言特性 (文章) • 深入 ASP․NET Core 6.0 專案範本的各種技術細節 (直播錄影) • Breaking changes in .NET 6 • Migrate from ASP.NET Core 5.0 to 6.0 38