Skip to content

Commit 7fb2c1a

Browse files
committed
fix(ci): 修复 NETSDK1102 错误,仅在 self-contained 发布时启用 trim/R2R
ILLink 10.0.8 把 PublishTrimmed 与 framework-dependent 不兼容由警告升级为错误, 导致 CI 三端 publish 失败。把 PublishTrimmed 与 PublishReadyToRun 加上 SelfContained=true 条件守护,并移除无效属性 <Trimming>full</Trimming>。 - framework-dependent (CLI):不启用 trim/R2R - self-contained (macOS GUI):trim/R2R 仍生效
1 parent 6a3ae7d commit 7fb2c1a

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/ImeWlConverterCmd/ImeWlConverterCmd.csproj

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<Version Condition="'$(Version)' == ''">3.3.1</Version>
99
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">3.3.1.0</AssemblyVersion>
1010
<FileVersion Condition="'$(FileVersion)' == ''">3.3.1.0</FileVersion>
11-
<Trimming>full</Trimming>
1211
</PropertyGroup>
1312

1413
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -19,21 +18,21 @@
1918
<!-- 发布优化配置 -->
2019
<DebugType>none</DebugType>
2120
<DebugSymbols>false</DebugSymbols>
22-
23-
<!-- 启用代码裁剪 -->
24-
<PublishTrimmed>true</PublishTrimmed>
25-
26-
<!-- 单文件发布 -->
21+
22+
<!-- 单文件发布(兼容 self-contained 与 framework-dependent) -->
2723
<PublishSingleFile>true</PublishSingleFile>
2824
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
29-
30-
<!-- 启用ReadyToRun优化 -->
31-
<PublishReadyToRun>true</PublishReadyToRun>
32-
25+
3326
<!-- 不包含PDB文件 -->
3427
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
3528
</PropertyGroup>
3629

30+
<!-- 仅在 self-contained 发布时启用裁剪与 ReadyToRun(NETSDK1102/NETSDK1094 要求) -->
31+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU' and '$(SelfContained)'=='true'">
32+
<PublishTrimmed>true</PublishTrimmed>
33+
<PublishReadyToRun>true</PublishReadyToRun>
34+
</PropertyGroup>
35+
3736
<ItemGroup>
3837
<PackageReference Include="UTF.Unknown" Version="2.5.1"/>
3938
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1"/>

0 commit comments

Comments
 (0)