build: 升级 target framework net9.0 → net10.0 (适配 macOS .NET 10 runtime)

This commit is contained in:
xiaoou
2026-07-04 10:53:41 +08:00
parent ea4388ee3e
commit 45a1036cbd
4 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@ -9,7 +9,7 @@
| 依赖 | 版本 | 说明 |
|------|------|------|
| .NET SDK | **9.0** | 编译和运行 |
| .NET SDK | **10.0** | 编译和运行 |
| YamlDotNet | 18.1.0 | NuGet 自动拉取,无需手动安装 |
| xUnit | 2.9.2 | 测试框架NuGet 自动拉取 |
| Git | 任意 | 拉取代码 |
@ -18,7 +18,7 @@
```bash
# 方式一:官网下载安装
# https://dotnet.microsoft.com/zh-cn/download/dotnet/9.0
# https://dotnet.microsoft.com/zh-cn/download/dotnet/10.0
# 选 macOS Arm64 (Apple Silicon) 或 x64 (Intel)
# 方式二Homebrew
@ -72,12 +72,12 @@ dotnet build
dotnet build -c Release
# 编译通过后输出:
# RuleEngine -> RuleEngine/bin/Debug/net9.0/RuleEngine.dll
# Demo -> Demo/bin/Debug/net9.0/Demo
# RuleEngine.Tests -> RuleEngine.Tests/bin/Debug/net9.0/RuleEngine.Tests.dll
# RuleEngine -> RuleEngine/bin/Debug/net10.0/RuleEngine.dll
# Demo -> Demo/bin/Debug/net10.0/Demo
# RuleEngine.Tests -> RuleEngine.Tests/bin/Debug/net10.0/RuleEngine.Tests.dll
```
编译产物在各自项目的 `bin/Debug/net9.0/` 下。Demo 的可执行文件是 `Demo/bin/Debug/net9.0/Demo`macOS 原生二进制)。
编译产物在各自项目的 `bin/Debug/net10.0/` 下。Demo 的可执行文件是 `Demo/bin/Debug/net10.0/Demo`macOS 原生二进制)。
---