- 移除了对系统程序集System.Threading.Tasks.dll的合并 - 添加了/target:exe参数确保正确生成exe文件 - 只合并必要的第三方依赖项EPPlus.dll 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.4 KiB
XML
34 lines
1.4 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<OutputType>WinExe</OutputType>
|
|
<TargetFramework>net48</TargetFramework>
|
|
<UseWindowsForms>true</UseWindowsForms>
|
|
<AssemblyName>ExcelMerger</AssemblyName>
|
|
<RootNamespace>ExcelMerger</RootNamespace>
|
|
<!-- 用于单文件发布的配置 -->
|
|
<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->'%(FullPath)', ' ')" />
|
|
<Message Text="ILRepack merge complete: $(OutputPath)$(AssemblyName)_merged.exe" Importance="high" />
|
|
</Target>
|
|
|
|
</Project> |