Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a87ee38

Browse files
layomiaeerhardt
andauthored
Bulk-suppress linker warnings during library builds (dotnet#40106)
* Enable verbose linker output and bulk-suppress warnings * Suppress ILLinker warnings for now, so ILLinker can enable warnings by default Co-authored-by: Eric Erhardt <[email protected]>
1 parent fbca802 commit a87ee38

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

eng/illink.targets

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@
216216
<ILLinkArgs>$(ILLinkArgs) --disable-opt unusedinterfaces</ILLinkArgs>
217217
<!-- keep DynamicDependencyAttribute unless a project explicitly disables it -->
218218
<ILLinkArgs Condition="'$(ILLinkKeepDepAttributes)' != 'false'">$(ILLinkArgs) --keep-dep-attributes true</ILLinkArgs>
219+
<!-- suppress warnings with the following codes:
220+
IL2006: The generic parameter 'T' from A with dynamically accessed member kinds B is passed into the generic parameter
221+
'T' from 'System.Lazy<T>' which requires dynamically accessed member kinds 'PublicParameterlessConstructor'
222+
IL2008: Could not find type A specified in resource B
223+
IL2009: Could not find method A in type B specified in resource C
224+
IL2012: Could not find field A in type B specified in resource C
225+
IL2025: Duplicate preserve of A in B
226+
IL2026: Calling A which has B can break functionality when trimming application code. The target method might be removed.
227+
IL2035: Unresolved assembly A in DynamicDependencyAttribute on B
228+
IL2041: The DynamicallyAccessedMembersAttribute is only allowed on method parameters, return value or generic parameters.
229+
-->
230+
<ILLinkArgs>$(ILLinkArgs) --nowarn IL2006;IL2008;IL2009;IL2012;IL2025;IL2026;IL2035;IL2041</ILLinkArgs>
219231
</PropertyGroup>
220232

221233
<MakeDir Directories="$(ILLinkTrimInputPath)" />

0 commit comments

Comments
 (0)