KennethCheng
|
4c2575317e
|
docs: 在 AGENTS.md 记录 WindowsAppSDK 2.4.0 self-contained 打包 bug + 修法
首次 build 后启动会报 AppNotificationManager.Register() 0x8007007E 找不到 Microsoft.WindowsAppRuntime.Insights.Resource.dll。
原因是 WindowsAppSDK 2.4.0 的 NuGet 包没把 Insights Resource DLL 打进 build 目录,只在系统级 WindowsAppRuntime 安装里才有。
提供两种修法:
- dev:从 C:\Program Files\WSL\wslsettings\(或任何已装 WindowsAppSDK 的程序)拷贝 5 个 DLL 到 build 目录
- prod:目标机器装 WindowsAppRuntime system-wide(winget install Microsoft.WindowsAppRuntime.2),或者 publish 后手工补这 5 个 DLL
已在 Gitea 的 build 验证里实测有效。
|
2026-09-06 20:30:48 +08:00 |
|
KennethCheng
|
c2f44767a6
|
feat: 落地 V1 全部源码 — WebSocket 通知 + 应用内历史查看
17 个源文件 + .gitignore + 默认 config.json 模板,严格按方案文档第 6 节实现。
用户核心场景:
- Windows 接收 Gotify 通知(WS /stream → AppNotificationBuilder)
- 应用内查看历史消息(打开 MainWindow 触发 GetRecentMessagesAsync,实时通过 MessageReceived 事件追加)
- 列表条目双击打开 extras.client::notification.click.url
关键变更点:
- GotifyMessage.Extras 类型由 Dictionary<string,object> 改为 Dictionary<string,JsonElement>,避免 System.Text.Json 反序列化时丢失嵌套结构
- 新增 HistoryConfig.ViewerLimit(默认 50,UI 硬上限 200)
- GotifyApiService.GetRecentMessagesAsync:since=0 拉最近 N 条,OrderByDescending(Id) 保证顺序
- GotifyWebSocketService 新增 MessageReceived 事件,MainWindow 用 Dispatcher.Invoke 切回 UI 线程追加
- NotificationService.AddArgument('url=...') 透传 click URL 给 OnNotificationInvoked
- MainWindow.xaml 增加 ListView + 刷新按钮,使用 ObservableCollection<GotifyMessage>
- 默认 config.json 用 https://gotify.example.com 占位 URL,ClientToken 留空,首启动自动写入 %LOCALAPPDATA%
依赖:Microsoft.WindowsAppSDK 2.4.0(方案文档固定版本)。
构建:本机 .NET 8 SDK 未安装,build 待用户在装好 SDK 后执行: dotnet restore && dotnet build -c Release
|
2026-09-06 18:44:55 +08:00 |
|