WinformsApp1/WinFormsApp1/WinFormsApp1.csproj
Developer 954e564318 添加程序图标和UI图标功能
1. 程序窗体显示app.ico图标
2. 两个浏览按钮使用app.ico图标显示
3. 添加错误处理,图标加载失败时回退到文字显示
4. 优化编译输出,减少终端窗口显示

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:43:07 +08:00

39 lines
1.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyName>ExcelMerger</AssemblyName>
<RootNamespace>ExcelMerger</RootNamespace>
<ApplicationIcon>app.ico</ApplicationIcon>
<!-- 用于单文件发布的配置 -->
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<PublishReadyToRun>true</PublishReadyToRun>
<!-- 强制将所有依赖项合并到输出目录 -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EPPlus" Version="4.5.3.3" />
<!-- 用于ILMerge合并依赖项 -->
<PackageReference Include="ILRepack" Version="2.0.18" />
</ItemGroup>
<!-- ILMerge后处理脚本 -->
<Target Name="ILRepack" AfterTargets="Build">
<ItemGroup>
<InputAssemblies Include="$(OutputPath)$(AssemblyName).exe" />
<InputAssemblies Include="$(OutputPath)EPPlus.dll" />
</ItemGroup>
<Message Text="ILRepack merging..." Importance="high" />
<Exec Command="$(PkgILRepack)\tools\ILRepack.exe /target:exe /out:$(OutputPath)$(AssemblyName)_merged.exe @(InputAssemblies-&gt;'%(FullPath)', ' ')" />
<Message Text="ILRepack merge complete: $(OutputPath)$(AssemblyName)_merged.exe" Importance="high" />
</Target>
<Target Name="CleanNuGetPackages" BeforeTargets="Build">
<RemoveDir Directories="$(OutputPath)" ContinueOnError="true" />
</Target>
</Project>