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
[UnconditionalSuppressMessage("AOT","IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",
80
+
Justification="Dynamic tests are opt-in and users are warned via RequiresDynamicCode on the method they call")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Dynamic tests require runtime compilation of lambda expressions and are not supported in native AOT scenarios.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Dynamic test instance creation requires Activator.CreateInstance and MakeGenericType which are not supported in native AOT scenarios.")]
147
151
[UnconditionalSuppressMessage("Trimming",
148
152
"IL2070:'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors()'",
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Dynamic test invocation requires LambdaExpression.Compile() which is not supported in native AOT scenarios.")]
Copy file name to clipboardExpand all lines: TUnit.Engine/Building/TestDataCollectorFactory.cs
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,6 @@ internal static class TestDataCollectorFactory
23
23
/// Creates a test data collector based on the specified or detected mode.
24
24
/// Source generation mode is preferred for AOT compatibility.
25
25
/// </summary>
26
-
[UnconditionalSuppressMessage("Trimming","IL2026:Using member 'TUnit.Engine.Discovery.ReflectionTestDataCollector.ReflectionTestDataCollector()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code",Justification="Reflection mode is explicitly chosen and cannot support trimming")]
27
-
[UnconditionalSuppressMessage("AOT","IL3050:Using member 'TUnit.Engine.Discovery.ReflectionTestDataCollector.ReflectionTestDataCollector()' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling",Justification="Reflection mode is explicitly chosen and cannot support AOT")]
/// Attempts AOT mode first, falls back to reflection if no source-generated tests found.
44
42
/// This provides automatic mode selection for optimal performance and compatibility.
45
43
/// </summary>
46
-
[UnconditionalSuppressMessage("Trimming","IL2026:Using member 'TUnit.Engine.Discovery.ReflectionTestDataCollector.ReflectionTestDataCollector()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code",Justification="Reflection mode is a fallback and cannot support trimming")]
47
-
[UnconditionalSuppressMessage("AOT","IL3050:Using member 'TUnit.Engine.Discovery.ReflectionTestDataCollector.ReflectionTestDataCollector()' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling",Justification="Reflection mode is a fallback and cannot support AOT")]
Copy file name to clipboardExpand all lines: TUnit.Engine/Discovery/ReflectionGenericTypeResolver.cs
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,34 @@
1
1
usingSystem.Diagnostics.CodeAnalysis;
2
2
usingSystem.Reflection;
3
+
usingSystem.Runtime.CompilerServices;
3
4
usingTUnit.Core;
4
5
5
6
namespaceTUnit.Engine.Discovery;
6
7
7
8
/// <summary>
8
9
/// Handles generic type resolution and instantiation for reflection-based test discovery
9
10
/// </summary>
10
-
[RequiresUnreferencedCode("Reflection-based generic type resolution requires unreferenced code")]
11
+
[UnconditionalSuppressMessage("Trimming","IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",Justification="Reflection mode cannot support trimming")]
12
+
[UnconditionalSuppressMessage("Trimming","IL2055:Call to 'System.Type.MakeGenericType' can not be statically analyzed",Justification="Reflection mode requires dynamic access")]
13
+
[UnconditionalSuppressMessage("Trimming","IL2065:Value passed to implicit 'this' parameter of method can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements",Justification="Reflection mode requires dynamic access")]
14
+
[UnconditionalSuppressMessage("Trimming","IL2067:Target parameter does not satisfy annotation requirements",Justification="Reflection mode requires dynamic access")]
15
+
[UnconditionalSuppressMessage("Trimming","IL2070:Target method does not satisfy annotation requirements",Justification="Reflection mode requires dynamic access")]
16
+
[UnconditionalSuppressMessage("Trimming","IL2075:'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethods(BindingFlags)'",Justification="Reflection mode requires dynamic access")]
17
+
[UnconditionalSuppressMessage("AOT","IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",Justification="Reflection mode cannot support AOT")]
11
18
internalstaticclassReflectionGenericTypeResolver
12
19
{
13
20
/// <summary>
14
21
/// Determines generic type arguments from data row values
// If no data row or empty data, can't determine types
@@ -68,9 +82,6 @@ internal static class ReflectionGenericTypeResolver
68
82
/// <summary>
69
83
/// Extracts generic type information including constraints
70
84
/// </summary>
71
-
[UnconditionalSuppressMessage("Trimming",
72
-
"IL2065:Value passed to implicit 'this' parameter of method 'System.Type.GetInterfaces()' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements",
@@ -106,9 +117,6 @@ internal static class ReflectionGenericTypeResolver
106
117
/// <summary>
107
118
/// Extracts generic method information including parameter positions
108
119
/// </summary>
109
-
[UnconditionalSuppressMessage("Trimming",
110
-
"IL2065:Value passed to implicit 'this' parameter of method 'System.Type.GetInterfaces()' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements",
[UnconditionalSuppressMessage("AOT","IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",
163
-
Justification="Reflection mode cannot support AOT")]
0 commit comments