From 01e5d5bdcc461c96aed8f033435a3eb11a09c78c Mon Sep 17 00:00:00 2001 From: hello Date: Sat, 15 Mar 2025 14:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/docs/frp.md | 0 notes/helloshop/aspire-postgresql.md | 0 notes/helloshop/upgrade-to-aspire-9.md | 65 ++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 notes/docs/frp.md create mode 100644 notes/helloshop/aspire-postgresql.md create mode 100644 notes/helloshop/upgrade-to-aspire-9.md diff --git a/notes/docs/frp.md b/notes/docs/frp.md new file mode 100644 index 0000000..e69de29 diff --git a/notes/helloshop/aspire-postgresql.md b/notes/helloshop/aspire-postgresql.md new file mode 100644 index 0000000..e69de29 diff --git a/notes/helloshop/upgrade-to-aspire-9.md b/notes/helloshop/upgrade-to-aspire-9.md new file mode 100644 index 0000000..c59315d --- /dev/null +++ b/notes/helloshop/upgrade-to-aspire-9.md @@ -0,0 +1,65 @@ +# 零度框架升级到 Aspire 9.0 版本 + +## 升级 Visual Studio 开发工具 + +使用 Visual Studio Installer 升级,升级到 v17.12 后,自动安装 .NET 9.0 SDK 和 Aspire 9.0 工作负载。 + +## 非 Visual Studio 开发环境 + +### 安装 .NET Core SDK 9.0 版本 + +[安装最新 .NET SDK 9.0 版](https://dotnet.microsoft.com/zh-cn/download) + +查看 .NET SDK 版本: + +```bash +dotnet --version +dotnet --list-sdks +``` + +### 升级 Aspire 工作负载 + +在项目目录下执行以下命令: + +```bash +dotnet workload uninstall aspire +dotnet workload install aspire +dotnet workload list +dotnet workload update +``` + +## 升级项目文件 + +Host 项目添加新节点: + +```xml + +``` +所有项目文件的目标框架改为 net9.0: + +```xml +net9.0 +``` + +安装 EF Core 基础包 + +```bash +dotnet add package Microsoft.EntityFrameworkCore +``` + +升级解决方案中所有 NuGet 包 + +```bash +dotnet package upgrade --to-latest +``` + +## 可使工具简化 + +https://learn.microsoft.com/zh-cn/dotnet/core/porting/upgrade-assistant-install + +## 服务发现支持 https+http 写法 + +```csharp +httpClient.BaseAddress = new Uri("https+http://identityservice") +``` +