You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/deploying/trimming/incompatibilities.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,24 @@ Automatic [COM marshalling](../../../standard/native-interop/cominterop.md) has
17
17
18
18
## WPF
19
19
20
-
The Windows Presentation Foundation (WPF) framework makes substantial use of reflection and some features are heavily reliant on run-time code inspection. In .NET 6, it's not possible for trimming analysis to preserve all necessary code for WPF applications. Unfortunately, almost no WPF apps are runnable after trimming, so trimming support for WPF has been disabled in the .NET 6 SDK.
20
+
The Windows Presentation Foundation (WPF) framework makes substantial use of reflection and some features are heavily reliant on run-time code inspection. In .NET 6, it's not possible for trimming analysis to preserve all necessary code for WPF applications. Unfortunately, almost no WPF apps are runnable after trimming, so trimming support for WPF is currently disabled in the .NET SDK. See [WPF is not trim-compatible](https://github.com/dotnet/wpf/issues/3811) issue for progress on enabling trimming for WPF.
21
21
22
22
## Windows Forms
23
23
24
-
The Windows Forms framework makes minimal use of reflection, but is heavily reliant on built-in COM marshalling. In .NET 6, it has not yet been converted to use ComWrappers. Unfortunately, almost no Windows Forms apps are runnable without built-in COM marshalling, so trimming support for Windows Forms apps has been disabled in the .NET 6 SDK.
24
+
The Windows Forms framework makes minimal use of reflection, but is heavily reliant on built-in COM marshalling. Unfortunately, almost no Windows Forms apps are runnable without built-in COM marshalling, so trimming support for Windows Forms apps is disabled in the .NET SDK currently. See [Make WinForms trim compatible](https://github.com/dotnet/winforms/issues/4649) issue for progress on enabling trimming for Windows Forms.
25
25
26
26
## Reflection-based serializers
27
27
28
-
Alternative: Reflection-free serializers, like source-generated [System.Text.Json](../../../standard/serialization/system-text-json/source-generation.md).
28
+
Alternative: Reflection-free serializers.
29
29
30
30
Many uses of reflection can be made trimming-compatible, as described in [Introduction to trim warnings](fixing-warnings.md). However, serializers tend to have very complex uses of reflection. Many of these uses cannot be made analyzable at build time. Unfortunately, the best option is often to rewrite the system to use source generation instead.
31
31
32
+
Popular reflection-based serializers and their recommended alternatives:
-**System.Runtime.Serialization.Formatters.Binary.BinaryFormatter** Recommended alternative: [Migrate away from BinaryFormatter serialization due to its security and reliability flaws.](../../compatibility/serialization/7.0/binaryformatter-apis-produce-errors.md#recommended-action)
37
+
32
38
## Dynamic assembly loading and execution
33
39
34
40
Trimming and dynamic assembly loading is a common problem for systems that support plugins or extensions, usually through APIs like <xref:System.Reflection.Assembly.LoadFrom(System.String)>. Trimming relies on seeing all assemblies at build time, so it knows which code is used and cannot be trimmed away. Most plugin systems load third-party code dynamically, so it's not possible for the trimmer to identify what code is needed.
Copy file name to clipboardExpand all lines: docs/core/deploying/trimming/trim-warnings/il2104.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,4 +11,4 @@ f1_keywords:
11
11
12
12
## Cause
13
13
14
-
The assembly 'assembly' produced trim analysis warnings in the context of the app. This means the assembly has not been fully annotated for trimming. Consider contacting the library author to request they add trim annotations to the library. To see detailed warnings for this assembly, turn off grouped warnings by passing either `--singlewarn-` ILLink command line option to showdetailedwarnings for all assemblies, or `--singlewarn- "assembly"` to show detailed warnings for that assembly. For more information on annotating libraries for trimming, see [Prepare .NET libraries for trimming](../prepare-libraries-for-trimming.md).
14
+
The assembly 'assembly' produced trim analysis warnings in the context of the app. This means the assembly has not been fully annotated for trimming. Consider contacting the library author to request they add trim annotations to the library. To see detailed warnings, turn off grouped warnings by setting [`<TrimmerSingleWarn>false</TrimmerSingleWarn>`](../trimming-options.md#show-detailed-warnings) property in your project file. For more information on annotating libraries for trimming, see [Prepare .NET libraries for trimming](../prepare-libraries-for-trimming.md).
0 commit comments