.net 5 源碼 解讀
1..Net 的體型架構:
AppModel
BCL
Runtime
2.框架升級,體積變大,無法適應雲開發,移動開發,不能按需加載,跨平台
.net core 大類庫拆分--組件化--nuget 按需加載安裝
c#/f# -->編譯器--.dll/exe(metadata,IL)-->CLR/JIT --機器碼01010101
多平台 CLR--BCL 一套支持
U3D是c++寫的底層,c#寫的邏輯
表面光鮮亮麗,背后千瘡百孔
.net framework(WPF,WinForms,ASP.NET) + .net core(.net core,asp.net core) + xamarin(ios,android)
3.net 5 統一開發平台:
desktop:window forms
web:asp.net
cloud azure
mobile:xamarin
game:
Iot:arm32,arm64
AI:
.net 6 LTS
4 .net 5 移除的:
ASP.NET webforms
wcf:windows communication foundation
wwf:window workflow foundation
vs2022
https://visualstudio.microsoft.com/zh-has/vs/preview/vs2022
5.asp.net core 源碼下載
https://github.com/dotnet/aspnetcore
https://github.com/dotnet/runtime //extend擴展卡
https://github.com/dotnet/kestrelhttpserver
https://pan.baidu.com/s/
源碼依賴node.js +java jdk
理解流程--擴展定制--掌握心法
理解設計模式,抓住核心套路
6.asp.netcore 全貌:
program:main-->startup初始化配置,IOC,HTTP Request,-->appsettings-->mvc
startup
mvc
appsettings
初始化 ---啟動流程:net6/asp.netcore/src/mvc/startvs.cmd啟動
請求來了--運行流程
實例化host: createwebhostbuilder:實例化builder --> 多次初始化
host.Run(): application -->middleware KesterlServerImpl
沒有runtime,沒有Kesterl
skywalking 鏈路追蹤:抓取請求信息,
hostingStartupAttribute,木馬
1.必須實現IHostingStartup
2.namespace 必須標記HostingStartup特性