File tree 1 file changed +2
-3
lines changed
src/DefaultBuilder/test/Microsoft.AspNetCore.TrimmingTests
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,9 @@ public static class X509Utilities
14
14
public static bool HasCertificateType =>
15
15
GetType ( "System.Security.Cryptography" , "System.Security.Cryptography.X509Certificates.X509Certificate" ) is not null ;
16
16
17
- [ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2026:RequiresUnreferencedCode " ,
17
+ [ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2057:UnrecognizedReflectionPattern " ,
18
18
Justification = "Returning null when the type is unreferenced is desirable" ) ]
19
19
private static Type ? GetType ( string assemblyName , string typeName ) {
20
- var assembly = AppDomain . CurrentDomain . GetAssemblies ( ) . SingleOrDefault ( a => a . GetName ( ) . Name == assemblyName ) ;
21
- return assembly ? . GetType ( typeName ) ;
20
+ return Type . GetType ( $ "{ typeName } , { assemblyName } ") ;
22
21
}
23
22
}
You can’t perform that action at this time.
0 commit comments