WinformsApp1/WinFormsApp1/WinFormsApp1.csproj

34 lines
1.4 KiB
XML
Raw Normal View History

2025-11-20 11:10:53 +08:00
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework>
2025-11-20 11:10:53 +08:00
<UseWindowsForms>true</UseWindowsForms>
<AssemblyName>ExcelMerger</AssemblyName>
<RootNamespace>ExcelMerger</RootNamespace>
<!-- 用于单文件发布的配置 -->
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<PublishReadyToRun>true</PublishReadyToRun>
<!-- 强制将所有依赖项合并到输出目录 -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
2025-11-20 11:10:53 +08:00
</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>
2025-11-20 11:10:53 +08:00
</Project>