|
37 | 37 | <UseWindowsForms>true</UseWindowsForms> |
38 | 38 | <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets> |
39 | 39 | <Platforms>AnyCPU;x86</Platforms> |
| 40 | + |
| 41 | + <!-- 允许引用 ImeWlConverterCmd.exe(NETSDK1151 规避,必须放消费方) --> |
| 42 | + <ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained> |
40 | 43 | </PropertyGroup> |
41 | 44 | <PropertyGroup> |
42 | 45 | <ManifestCertificateThumbprint>D023E0A7D1F29511E571C5D888823CF5150F5061</ManifestCertificateThumbprint> |
@@ -96,40 +99,38 @@ GitHub: https://github.com/studyzy/imewlconverter</Description> |
96 | 99 | <!-- Release发布优化配置 --> |
97 | 100 | <DebugType>none</DebugType> |
98 | 101 | <DebugSymbols>false</DebugSymbols> |
99 | | - |
| 102 | + |
100 | 103 | <!-- 禁用代码裁剪 (Windows Forms不支持trimming) --> |
101 | 104 | <PublishTrimmed>false</PublishTrimmed> |
102 | | - |
103 | | - <!-- 单文件发布 --> |
| 105 | + |
| 106 | + <!-- 单文件发布(兼容 self-contained 与 framework-dependent) --> |
104 | 107 | <PublishSingleFile>true</PublishSingleFile> |
105 | 108 | <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> |
106 | | - <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile> |
107 | | - |
108 | | - <!-- 启用ReadyToRun优化 --> |
109 | | - <PublishReadyToRun>true</PublishReadyToRun> |
110 | | - |
| 109 | + |
111 | 110 | <!-- 不包含PDB文件 --> |
112 | 111 | <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory> |
113 | 112 | </PropertyGroup> |
114 | 113 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'"> |
115 | 114 | <!-- Release发布优化配置 --> |
116 | 115 | <DebugType>none</DebugType> |
117 | 116 | <DebugSymbols>false</DebugSymbols> |
118 | | - |
| 117 | + |
119 | 118 | <!-- 禁用代码裁剪 (Windows Forms不支持trimming) --> |
120 | 119 | <PublishTrimmed>false</PublishTrimmed> |
121 | | - |
122 | | - <!-- 单文件发布 --> |
| 120 | + |
| 121 | + <!-- 单文件发布(兼容 self-contained 与 framework-dependent) --> |
123 | 122 | <PublishSingleFile>true</PublishSingleFile> |
124 | 123 | <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> |
125 | | - <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile> |
126 | | - |
127 | | - <!-- 启用ReadyToRun优化 --> |
128 | | - <PublishReadyToRun>true</PublishReadyToRun> |
129 | | - |
| 124 | + |
130 | 125 | <!-- 不包含PDB文件 --> |
131 | 126 | <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory> |
132 | 127 | </PropertyGroup> |
| 128 | + |
| 129 | + <!-- 仅在 self-contained 发布时启用 ReadyToRun 与单文件压缩(framework-dependent 不支持) --> |
| 130 | + <PropertyGroup Condition="'$(Configuration)'=='Release' and '$(SelfContained)'=='true'"> |
| 131 | + <EnableCompressionInSingleFile>true</EnableCompressionInSingleFile> |
| 132 | + <PublishReadyToRun>true</PublishReadyToRun> |
| 133 | + </PropertyGroup> |
133 | 134 | <ItemGroup> |
134 | 135 | <PackageReference Include="Microsoft.Office.Interop.Word" Version="15.0.4797.1004" /> |
135 | 136 | <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.7" /> |
|
0 commit comments