「ASP.NET Core」修訂間的差異
跳至導覽
跳至搜尋
小 (→技術文件) |
|||
(未顯示同一使用者於中間所作的 14 次修訂) | |||
行 1: | 行 1: | ||
'''ASP.NET Core''',{{wikipedia|ASP.NET_Core|lang=en}} | '''ASP.NET Core''',{{wikipedia|ASP.NET_Core|lang=en}} | ||
+ | *[https://github.com/dotnet/aspnetcore GitHub - dotnet/aspnetcore: ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.] | ||
− | ==版本== | + | ==技術文件== |
+ | *[https://docs.microsoft.com/zh-tw/aspnet/core/introduction-to-aspnet-core ASP.NET Core 簡介 | Microsoft Docs] | ||
+ | |||
+ | *Web應用程式 | ||
+ | **[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/razor-pages/ Razor] | ||
+ | **[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/first-mvc-app/start-mvc MVC] | ||
+ | **[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/build-a-blazor-app Blazor] | ||
+ | *[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/first-web-api WebAPI] | ||
+ | *[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/signalr SignalR] | ||
+ | *[https://docs.microsoft.com/zh-tw/aspnet/core/tutorials/grpc/grpc-start gRPC] | ||
+ | |||
+ | ;範例 | ||
+ | *[https://github.com/dotnet/AspNetCore.Docs GitHub - dotnet/AspNetCore.Docs: Documentation for ASP.NET Core] | ||
+ | ;其他 | ||
+ | *[https://github.com/MoienTajik/AspNetCore-Developer-Roadmap/blob/master/ReadMe.zh-Hant.md ASP.NET Core 開發人員指南(AspNetCore-Developer-Roadmap)] | ||
+ | *[https://github.com/thangchung/awesome-dotnet-core Awesome .NET Core] | ||
+ | |||
+ | ==應用== | ||
+ | ;檔案上傳 | ||
+ | *[https://www.codeproject.com/Articles/5257067/How-to-Upload-a-Document-in-ASP-NET-Core How to Upload a Document in ASP.NET Core - CodeProject] | ||
+ | *[https://blog.darkthread.net/blog/aspnet-core-cors-upload-svc/ 用 50 行 Program.cs 寫個 ASP.NET Core CORS 上傳服務-黑暗執行緒] | ||
+ | |||
+ | ;其他 | ||
+ | *[https://www.codeproject.com/Articles/1242270/Custom-Code-Generator-Using-ASP-NET-Core Custom Code-Generator Using ASP.NET Core - CodeProject] | ||
+ | *[https://www.codewithmukesh.com/blog/send-emails-with-aspnet-core/ Send Emails with ASP.NET Core in 5 EASY Steps - Guide] | ||
+ | |||
+ | ==FAQ== | ||
+ | ===版本=== | ||
{| class="wikitable" | {| class="wikitable" | ||
!Version Number | !Version Number | ||
行 56: | 行 84: | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | + | ===部署=== | |
− | *[https:// | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/ 裝載及部署 ASP.NET Core | Microsoft Docs] |
− | + | ;預設 (跨平台) | |
− | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/fundamentals/servers/kestrel Kestrel (ASP.NET Core 中預設的 web 伺服器執行) | Microsoft Docs] | |
− | + | ;Azure App Service | |
− | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/azure-apps 將 ASP.NET Core 應用程式部署至 Azure App Service | Microsoft Docs] | |
− | + | *[https://docs.microsoft.com/zh-tw/azure/app-service/quickstart-dotnetcore?tabs=net60&pivots=development-environment-vs 快速入門:部署 ASP.NET web 應用程式 - Azure App Service | Microsoft Docs] | |
− | + | *[https://docs.microsoft.com/zh-tw/dotnet/architecture/devops-for-aspnet-developers/deploying-to-app-service 為 ASP.NET Core 開發人員將應用程式部署至 App Service DevOps | Microsoft Docs] | |
− | *[https://docs.microsoft.com/zh-tw/ | + | ;Windows |
− | *[https://docs.microsoft.com/zh-tw/aspnet/core/ | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/iis/ 在使用 IIS 的 Windows 上裝載 ASP.NET Core | Microsoft Docs] |
− | *[https://docs.microsoft.com/zh-tw/aspnet/core/ | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/windows-service 在 Windows 服務上裝載 ASP.NET Core | Microsoft Docs] |
− | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/fundamentals/servers/httpsys ASP.NET Core 中的 HTTP.sys 網頁伺服器實作 | Microsoft Docs] | |
− | + | ;Linux | |
− | *[https:// | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/linux-apache 在 Linux 上使用 Apache 裝載 ASP.NET Core | Microsoft Docs] |
− | *[https:// | + | *[https://docs.microsoft.com/zh-tw/aspnet/core/host-and-deploy/linux-nginx 在 Linux 上使用 Nginx 裝載 ASP.NET Core | Microsoft Docs] |
− | *[https:// | + | *[https://blog.miniasp.com/post/2021/09/27/How-to-create-TLS-certificate-in-Linux-and-make-Kestrel-works 如何在 Linux 正確建立自簽憑證並讓 ASP.NET Core 網站可以順利進行連線 | The Will Will Web] |
− | |||
− | |||
− | |||
− | *[https:// | ||
===轉移=== | ===轉移=== | ||
行 92: | 行 113: | ||
**[https://blog.darkthread.net/blog/apnetcore-31-to-50-experience/ ASP.NET Core 3.1 升級 5.0 經驗一則-黑暗執行緒] | **[https://blog.darkthread.net/blog/apnetcore-31-to-50-experience/ ASP.NET Core 3.1 升級 5.0 經驗一則-黑暗執行緒] | ||
*[https://docs.microsoft.com/zh-tw/aspnet/core/migration/50-to-60?view=aspnetcore-6.0&tabs=visual-studio 從 ASP.NET Core 5.0 遷移至6.0 | Microsoft Docs] | *[https://docs.microsoft.com/zh-tw/aspnet/core/migration/50-to-60?view=aspnetcore-6.0&tabs=visual-studio 從 ASP.NET Core 5.0 遷移至6.0 | Microsoft Docs] | ||
+ | |||
+ | ===Session機制=== | ||
+ | ;使用SQL Server | ||
+ | *[https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed#distributed-sql-server-cache Distributed SQL Server Cache in ASP.NET Core | Microsoft Docs] | ||
+ | ** 安裝套件[https://www.nuget.org/packages/Microsoft.Extensions.Caching.SqlServer/ Microsoft.Extensions.Caching.SqlServer] | ||
+ | ** 需自訂資料表,請照著Distributed SQL Server Cache的說明操作 | ||
+ | |||
+ | ;使用[[Redis]] | ||
+ | *[https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed#distributed-redis-cache Distributed Redis Cache in ASP.NET Core | Microsoft Docs] | ||
+ | ** 安裝套件[https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis Microsoft.Extensions.Caching.StackExchangeRedis] | ||
+ | services.AddStackExchangeRedisCache(options => | ||
+ | { | ||
+ | options.Configuration = "127.0.0.1:6379"; //指定使用的Redis Server來源 | ||
+ | }); | ||
+ | |||
+ | ===使用ELMAH紀錄執行時的錯誤訊息=== | ||
+ | *[https://github.com/ElmahCore/ElmahCore ElmahCore] is ELMAH for Net.Standard and Net.Core | ||
+ | **[https://www.nuget.org/packages/ElmahCore/ NuGet Gallery | ElmahCore] | ||
+ | <!-- 另一套與ELMAH類似的付費套件(雲端版) | ||
+ | *[https://docs.elmah.io/logging-to-elmah-io-from-aspnet-core/ Logging from ASP.NET Core | elmah.io] | ||
+ | //--> | ||
===ASP.NET Core 3.0以後不再從NuGet提供=== | ===ASP.NET Core 3.0以後不再從NuGet提供=== | ||
行 98: | 行 140: | ||
# 在 .csproj 檔案的 <ItemGroup> 區塊內加上 | # 在 .csproj 檔案的 <ItemGroup> 區塊內加上 | ||
<FrameworkReference Include="Microsoft.AspNetCore.App"/> | <FrameworkReference Include="Microsoft.AspNetCore.App"/> | ||
− | + | ===把ASP.NET Core打包成桌面應用程式=== | |
− | === | + | ;第一型,使用[https://github.com/ElectronNET/Electron.NET Electron.NET] |
− | *[https://blog. | + | *[https://blog.darkthread.net/blog/electron-net/ 用 ASP.NET Core 寫桌面 GUI 應用程式 - Electron.NET-黑暗執行緒] |
+ | ;第二型,執行時使用Windows預設的瀏覽器 | ||
+ | *[https://blog.darkthread.net/blog/minapi-dyna-port/ 打造極簡式 ASP.NET Core 桌面小工具 - 動態 Port 與啟動瀏覽器-黑暗執行緒] | ||
+ | *[https://blog.darkthread.net/blog/miniapi-auto-close/ 打造極簡式 ASP.NET Core 桌面小工具 - 網頁關閉自動結束-黑暗執行緒] | ||
+ | ===文字被編碼問題=== | ||
+ | *[https://blog.darkthread.net/blog/dotnet-unicoderanges/ .NET Core .cshtml 及 JSON 之 UnicodeRange 編碼範圍設定-黑暗執行緒] | ||
==相關== | ==相關== | ||
+ | *[[ASP.NET Core Identity]] | ||
+ | *[[ASP.NET Core MVC]] | ||
+ | *[[ASP.NET Core SignalR]] | ||
*[[Entity Framework Core]] | *[[Entity Framework Core]] | ||
− | |||
− | |||
[[分類:ASP.NET Core]] | [[分類:ASP.NET Core]] | ||
+ | [[分類:網頁應用程式框架]] |
於 2022年3月2日 (三) 23:12 的修訂
ASP.NET Core,參照:『維基百科~ASP.NET_Core』
技術文件
- 範例
- 其他
應用
- 檔案上傳
- How to Upload a Document in ASP.NET Core - CodeProject
- 用 50 行 Program.cs 寫個 ASP.NET Core CORS 上傳服務-黑暗執行緒
- 其他
- Custom Code-Generator Using ASP.NET Core - CodeProject
- Send Emails with ASP.NET Core in 5 EASY Steps - Guide
FAQ
版本
Version Number | Release Date | End of Support | Supported Visual Studio Version(s) |
---|---|---|---|
1.0 | 2016-06-27 | 2019-06-27 | 2015, 2017 |
1.1 | 2016-11-18 | 2019-06-27 | 2015, 2017 |
2.0 | 2017-08-14 | 2018-10-01 | 2017 |
2.1 LTS | 2018-05-30 | 2021-08-21 | 2017 |
2.2 | 2018-12-04 | 2019-12-23 | 2017 15.9 and 2019 16.0 preview 1 |
3.0 | 2019-09-23 | 2020-03-03 | 2017, 2019 |
3.1 LTS | 2019-12-03 | 2022-12-03 | 2019 |
5.0 | 2020-11-10 | 2020-05-08 | 2019(16.8) |
6.0 LTS | 2021-11-08 | 2024-11-08 | 2022(17) |
部署
- 預設 (跨平台)
- Azure App Service
- 將 ASP.NET Core 應用程式部署至 Azure App Service | Microsoft Docs
- 快速入門:部署 ASP.NET web 應用程式 - Azure App Service | Microsoft Docs
- 為 ASP.NET Core 開發人員將應用程式部署至 App Service DevOps | Microsoft Docs
- Windows
- 在使用 IIS 的 Windows 上裝載 ASP.NET Core | Microsoft Docs
- 在 Windows 服務上裝載 ASP.NET Core | Microsoft Docs
- ASP.NET Core 中的 HTTP.sys 網頁伺服器實作 | Microsoft Docs
- Linux
- 在 Linux 上使用 Apache 裝載 ASP.NET Core | Microsoft Docs
- 在 Linux 上使用 Nginx 裝載 ASP.NET Core | Microsoft Docs
- 如何在 Linux 正確建立自簽憑證並讓 ASP.NET Core 網站可以順利進行連線 | The Will Will Web
轉移
- 從 ASP.NET 移轉至 ASP.NET Core | Microsoft Docs
- 從 ASP.NET Core 1.x 遷移至 2.0 | Microsoft Docs
- 從 ASP.NET Core 2.0 移轉到 2.1 | Microsoft Docs
- 從 ASP.NET Core 2.1 遷移至2.2 | Microsoft Docs
- 從 ASP.NET Core 2.2 遷移至3.0 | Microsoft Docs
- 從 ASP.NET Core 3.0 遷移至3.1 | Microsoft Docs
- ASP.NET Core 3.1 升級 5.0
- 從 ASP.NET Core 5.0 遷移至6.0 | Microsoft Docs
Session機制
- 使用SQL Server
- Distributed SQL Server Cache in ASP.NET Core | Microsoft Docs
- 安裝套件Microsoft.Extensions.Caching.SqlServer
- 需自訂資料表,請照著Distributed SQL Server Cache的說明操作
- 使用Redis
services.AddStackExchangeRedisCache(options => { options.Configuration = "127.0.0.1:6379"; //指定使用的Redis Server來源 });
使用ELMAH紀錄執行時的錯誤訊息
- ElmahCore is ELMAH for Net.Standard and Net.Core
ASP.NET Core 3.0以後不再從NuGet提供
- Download .NET Core SDK
- 在 .csproj 檔案的 <ItemGroup> 區塊內加上
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
把ASP.NET Core打包成桌面應用程式
- 第一型,使用Electron.NET
- 第二型,執行時使用Windows預設的瀏覽器