@@ -102,8 +102,6 @@ public static partial class Activator
102
102
103
103
[ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2026:RequiresUnreferencedCode" ,
104
104
Justification = "Implementation detail of Activator that linker intrinsically recognizes" ) ]
105
- [ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2057:UnrecognizedReflectionPattern" ,
106
- Justification = "Implementation detail of Activator that linker intrinsically recognizes" ) ]
107
105
[ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2072:UnrecognizedReflectionPattern" ,
108
106
Justification = "Implementation detail of Activator that linker intrinsically recognizes" ) ]
109
107
[ UnconditionalSuppressMessage ( "ReflectionAnalysis" , "IL2096:UnrecognizedReflectionPattern" ,
@@ -118,32 +116,18 @@ public static partial class Activator
118
116
object ? [ ] ? activationAttributes ,
119
117
ref StackCrawlMark stackMark )
120
118
{
121
- Type ? type = null ;
122
- Assembly ? assembly = null ;
119
+ Assembly assembly ;
123
120
if ( assemblyString == null )
124
121
{
125
122
assembly = Assembly . GetExecutingAssembly ( ref stackMark ) ;
126
123
}
127
124
else
128
125
{
129
126
AssemblyName assemblyName = new AssemblyName ( assemblyString ) ;
130
-
131
- if ( assemblyName . ContentType == AssemblyContentType . WindowsRuntime )
132
- {
133
- // WinRT type - we have to use Type.GetType
134
- type = Type . GetType ( typeName + ", " + assemblyString , throwOnError : true , ignoreCase ) ;
135
- }
136
- else
137
- {
138
- // Classic managed type
139
- assembly = RuntimeAssembly . InternalLoad ( assemblyName , ref stackMark , AssemblyLoadContext . CurrentContextualReflectionContext ) ;
140
- }
127
+ assembly = RuntimeAssembly . InternalLoad ( assemblyName , ref stackMark , AssemblyLoadContext . CurrentContextualReflectionContext ) ;
141
128
}
142
129
143
- if ( type == null )
144
- {
145
- type = assembly ! . GetType ( typeName , throwOnError : true , ignoreCase ) ;
146
- }
130
+ Type ? type = assembly . GetType ( typeName , throwOnError : true , ignoreCase ) ;
147
131
148
132
object ? o = CreateInstance ( type ! , bindingAttr , binder , args , culture , activationAttributes ) ;
149
133
0 commit comments