# WpfAdmin.Polaris **Repository Path**: wpfadmin/wa.polaris ## Basic Information - **Project Name**: WpfAdmin.Polaris - **Description**: No description available - **Primary Language**: C# - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-09 - **Last Updated**: 2025-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 项目说明 ## 项目简介 WPF Admin Polaris 已升级至 **.NET 10 (net10.0-windows10.0.19041)**,采用: - **MVVM**: CommunityToolkit.Mvvm - **DI**: Microsoft.Extensions.DependencyInjection - **数据**: Microsoft.Data.Sqlite + EF Core (Code-First) + Dapper - **UI**: HandyControls ## 环境准备 - .NET SDK 10(预览/正式) - Windows 10 20H1 (10.0.19041) 及以上 ## 运行 ``` dotnet build -c Debug dotnet run --project WpfAdmin.Polaris ``` ### 插件与管理(M2) - 示例插件:`src/WpfAdmin.Polaris.SamplePlugin` - 宿主作为内置插件:`src/WpfAdmin.Polaris.Host/HostPlugin.cs`(清单:`src/WpfAdmin.Polaris.Host/manifest.json`) - 启动后左侧会出现“插件”分组: - “插件管理”:进入宿主插件提供的管理界面,可刷新、启用/禁用、卸载、查看详情; - 示例插件:如 `Plugins/SamplePlugin/` 下存在示例 DLL 与 `manifest.json`。 - 开发期运行:程序会尝试将示例插件的 DLL 和清单复制到运行目录 `Plugins/SamplePlugin/`。 注意:如使用 Release 配置,请同步调整 `WpfAdmin.Polaris/App.xaml.cs` 中用于复制示例插件的绝对路径。 ## EF Core Code-First 使用说明(扩展表结构) 1. 修改或新增实体(示例:`WpfAdmin.Polaris/Data/Entities/BookmarkItem.cs`) 2. 生成迁移: ``` cd WpfAdmin.Polaris dotnet ef migrations add -o Data/Migrations ``` 3. 应用迁移到数据库: ``` dotnet ef database update ``` 4. 回滚(可选): ``` dotnet ef database update ``` 数据库文件默认:`WpfAdmin.Polaris/app.db` ## 发布配置(win-x64) 已内置两个发布配置文件(Publish Profiles): - 普通发布(依赖本机运行时):`Properties/PublishProfiles/Folder-win-x64.pubxml` - 单文件自包含发布:`Properties/PublishProfiles/Folder-win-x64-singlefile.pubxml` 发布命令示例: ``` cd WpfAdmin.Polaris dotnet publish -c Release /p:PublishProfile=Properties/PublishProfiles/Folder-win-x64.pubxml dotnet publish -c Release /p:PublishProfile=Properties/PublishProfiles/Folder-win-x64-singlefile.pubxml ``` 发布输出目录: - 普通:`bin/Release/publish/win-x64/` - 单文件:`bin/Release/publish/win-x64-single/` ## Edge 书签导入(入库)服务 服务接口与实现: - `Services/IEdgeBookmarkImportService.cs` - `Services/EdgeBookmarkImportService.cs` 使用方式(示例):在需要处通过 DI 获取 `IEdgeBookmarkImportService` 调用 `ImportFromEdge()`。目前示例实现会将带 `Url` 的节点(忽略文件夹)按 `Url` 去重后写入 `BookmarkItems` 表,包含字段:`Name`、`Url`、`Folder`。 ## WpfAdmin.Everything 兼容性提示 当前引用版本:`1.0.5`。NuGet 显示其仅标注了 .NET Framework 目标(NU1701 警告),未提供 `net6.0-windows`/`net8.0-windows`/`net10.0-windows` 资产。因此会出现“可能不完全兼容”的警告。建议: - 如果包由本仓库作者维护,建议补充针对 Windows 桌面目标(如 `net6.0-windows10.0.19041`)的编译资产并重新发布; - 或在本项目中将其替换为同等功能的 `net6+` 兼容实现; - 若确认运行时可用且无崩溃,可暂时忽略此警告,但持续改进为佳。