










dotnet tool install --global AvaloniaUI.Parcel一个干净的Avalonia MVVM项目的.csproj应该是这样的:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<!-- 这些打包属性是给 Parcel 读取的,不是必需的 -->
<ApplicationName>AvaloniaMvvmNew</ApplicationName>
<PackageName>avalonia-mvvm-new</PackageName>
<AssemblyVersion>1.0.0</AssemblyVersion>
</PropertyGroup>
<!-- 只需要 Avalonia 相关的包,不要加 Parcel 包引用 -->
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
</ItemGroup>
</Project>
。Parecel 的打包功能是铜鼓偶命令行或图形界面直接调用的
。不需要在.csproj中添加特殊的包引用
既然Parcel 是独立的工具,打包的命令应该是这样的:
# 1. 进入项目目录
cd F:\Demos\AvaloniaDemos\t3\AvaloniaMvvmNew
# 2. 先发布项目(生成可执行文件)
dotnet publish -c Release -r linux-x64 --self-contained true -o ./publish/linux-x64
# 3. 使用 parcel 命令打包(不是 dotnet build -t:ParcelBuildDeb)
parcel pack ./publish/linux-x64 --output ./installers --platform linux --format deb



此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。