mscorlib(4.0.0.0) API with additions
Assembly.cs
4 using System.IO;
8 using System.Security;
10 using System.Security.Policy;
11 using System.Threading;
12 
13 namespace System.Reflection
14 {
16  [Serializable]
17  [ClassInterface(ClassInterfaceType.None)]
18  [ComDefaultInterface(typeof(_Assembly))]
19  [ComVisible(true)]
20  [__DynamicallyInvokable]
21  [PermissionSet(SecurityAction.InheritanceDemand, Unrestricted = true)]
23  {
26  public virtual string CodeBase
27  {
28  get
29  {
30  throw new NotImplementedException();
31  }
32  }
33 
36  public virtual string EscapedCodeBase
37  {
38  [SecuritySafeCritical]
39  get
40  {
41  return AssemblyName.EscapeCodeBase(CodeBase);
42  }
43  }
44 
47  [__DynamicallyInvokable]
48  public virtual string FullName
49  {
50  [__DynamicallyInvokable]
51  get
52  {
53  throw new NotImplementedException();
54  }
55  }
56 
59  [__DynamicallyInvokable]
60  public virtual MethodInfo EntryPoint
61  {
62  [__DynamicallyInvokable]
63  get
64  {
65  throw new NotImplementedException();
66  }
67  }
68 
71  [__DynamicallyInvokable]
72  public virtual IEnumerable<Type> ExportedTypes
73  {
74  [__DynamicallyInvokable]
75  get
76  {
77  return GetExportedTypes();
78  }
79  }
80 
83  [__DynamicallyInvokable]
84  public virtual IEnumerable<TypeInfo> DefinedTypes
85  {
86  [__DynamicallyInvokable]
87  get
88  {
89  Type[] types = GetTypes();
90  TypeInfo[] array = new TypeInfo[types.Length];
91  for (int i = 0; i < types.Length; i++)
92  {
93  TypeInfo typeInfo = types[i].GetTypeInfo();
94  if (typeInfo == null)
95  {
96  throw new NotSupportedException(Environment.GetResourceString("NotSupported_NoTypeInfo", types[i].FullName));
97  }
98  array[i] = typeInfo;
99  }
100  return array;
101  }
102  }
103 
106  public virtual Evidence Evidence
107  {
108  get
109  {
110  throw new NotImplementedException();
111  }
112  }
113 
116  public virtual PermissionSet PermissionSet
117  {
118  [SecurityCritical]
119  get
120  {
121  throw new NotImplementedException();
122  }
123  }
124 
128  public bool IsFullyTrusted
129  {
130  [SecuritySafeCritical]
131  get
132  {
133  return PermissionSet.IsUnrestricted();
134  }
135  }
136 
139  public virtual SecurityRuleSet SecurityRuleSet
140  {
141  get
142  {
143  throw new NotImplementedException();
144  }
145  }
146 
149  [ComVisible(false)]
150  [__DynamicallyInvokable]
151  public virtual Module ManifestModule
152  {
153  [__DynamicallyInvokable]
154  get
155  {
156  RuntimeAssembly runtimeAssembly = this as RuntimeAssembly;
157  if (runtimeAssembly != null)
158  {
159  return runtimeAssembly.ManifestModule;
160  }
161  throw new NotImplementedException();
162  }
163  }
164 
167  [__DynamicallyInvokable]
169  {
170  [__DynamicallyInvokable]
171  get
172  {
173  return GetCustomAttributesData();
174  }
175  }
176 
180  [ComVisible(false)]
181  public virtual bool ReflectionOnly
182  {
183  get
184  {
185  throw new NotImplementedException();
186  }
187  }
188 
191  [__DynamicallyInvokable]
192  public virtual IEnumerable<Module> Modules
193  {
194  [__DynamicallyInvokable]
195  get
196  {
197  return GetLoadedModules(getResourceModules: true);
198  }
199  }
200 
204  public virtual string Location
205  {
206  get
207  {
208  throw new NotImplementedException();
209  }
210  }
211 
214  [ComVisible(false)]
215  public virtual string ImageRuntimeVersion
216  {
217  get
218  {
219  throw new NotImplementedException();
220  }
221  }
222 
226  public virtual bool GlobalAssemblyCache
227  {
228  get
229  {
230  throw new NotImplementedException();
231  }
232  }
233 
236  [ComVisible(false)]
237  public virtual long HostContext
238  {
239  get
240  {
241  RuntimeAssembly runtimeAssembly = this as RuntimeAssembly;
242  if (runtimeAssembly != null)
243  {
244  return runtimeAssembly.HostContext;
245  }
246  throw new NotImplementedException();
247  }
248  }
249 
253  [__DynamicallyInvokable]
254  public virtual bool IsDynamic
255  {
256  [__DynamicallyInvokable]
257  get
258  {
259  return false;
260  }
261  }
262 
264  public virtual event ModuleResolveEventHandler ModuleResolve
265  {
266  [SecurityCritical]
267  add
268  {
269  throw new NotImplementedException();
270  }
271  [SecurityCritical]
272  remove
273  {
274  throw new NotImplementedException();
275  }
276  }
277 
282  public static string CreateQualifiedName(string assemblyName, string typeName)
283  {
284  return typeName + ", " + assemblyName;
285  }
286 
292  public static Assembly GetAssembly(Type type)
293  {
294  if (type == null)
295  {
296  throw new ArgumentNullException("type");
297  }
298  Module module = type.Module;
299  if (module == null)
300  {
301  return null;
302  }
303  return module.Assembly;
304  }
305 
311  [__DynamicallyInvokable]
312  public static bool operator ==(Assembly left, Assembly right)
313  {
314  if ((object)left == right)
315  {
316  return true;
317  }
318  if ((object)left == null || (object)right == null || left is RuntimeAssembly || right is RuntimeAssembly)
319  {
320  return false;
321  }
322  return left.Equals(right);
323  }
324 
330  [__DynamicallyInvokable]
331  public static bool operator !=(Assembly left, Assembly right)
332  {
333  return !(left == right);
334  }
335 
340  [__DynamicallyInvokable]
341  public override bool Equals(object o)
342  {
343  return base.Equals(o);
344  }
345 
348  [__DynamicallyInvokable]
349  public override int GetHashCode()
350  {
351  return base.GetHashCode();
352  }
353 
367  [MethodImpl(MethodImplOptions.NoInlining)]
368  [SecuritySafeCritical]
369  public static Assembly LoadFrom(string assemblyFile)
370  {
371  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
372  return RuntimeAssembly.InternalLoadFrom(assemblyFile, null, null, AssemblyHashAlgorithm.None, forIntrospection: false, suppressSecurityChecks: false, ref stackMark);
373  }
374 
390  [MethodImpl(MethodImplOptions.NoInlining)]
391  [SecuritySafeCritical]
392  public static Assembly ReflectionOnlyLoadFrom(string assemblyFile)
393  {
394  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
395  return RuntimeAssembly.InternalLoadFrom(assemblyFile, null, null, AssemblyHashAlgorithm.None, forIntrospection: true, suppressSecurityChecks: false, ref stackMark);
396  }
397 
412  [MethodImpl(MethodImplOptions.NoInlining)]
413  [SecuritySafeCritical]
414  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
415  public static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence)
416  {
417  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
418  return RuntimeAssembly.InternalLoadFrom(assemblyFile, securityEvidence, null, AssemblyHashAlgorithm.None, forIntrospection: false, suppressSecurityChecks: false, ref stackMark);
419  }
420 
437  [MethodImpl(MethodImplOptions.NoInlining)]
438  [SecuritySafeCritical]
439  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
440  public static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
441  {
442  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
443  return RuntimeAssembly.InternalLoadFrom(assemblyFile, securityEvidence, hashValue, hashAlgorithm, forIntrospection: false, suppressSecurityChecks: false, ref stackMark);
444  }
445 
462  [MethodImpl(MethodImplOptions.NoInlining)]
463  [SecuritySafeCritical]
464  public static Assembly LoadFrom(string assemblyFile, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
465  {
466  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
467  return RuntimeAssembly.InternalLoadFrom(assemblyFile, null, hashValue, hashAlgorithm, forIntrospection: false, suppressSecurityChecks: false, ref stackMark);
468  }
469 
484  [MethodImpl(MethodImplOptions.NoInlining)]
485  [SecurityCritical]
486  public static Assembly UnsafeLoadFrom(string assemblyFile)
487  {
488  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
489  return RuntimeAssembly.InternalLoadFrom(assemblyFile, null, null, AssemblyHashAlgorithm.None, forIntrospection: false, suppressSecurityChecks: true, ref stackMark);
490  }
491 
504  [MethodImpl(MethodImplOptions.NoInlining)]
505  [SecuritySafeCritical]
506  [__DynamicallyInvokable]
507  public static Assembly Load(string assemblyString)
508  {
509  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
510  return RuntimeAssembly.InternalLoad(assemblyString, null, ref stackMark, forIntrospection: false);
511  }
512 
513  [MethodImpl(MethodImplOptions.NoInlining)]
514  [SecuritySafeCritical]
515  internal static Type GetType_Compat(string assemblyString, string typeName)
516  {
517  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
518  RuntimeAssembly assemblyFromResolveEvent;
519  AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, forIntrospection: false, out assemblyFromResolveEvent);
520  if (assemblyFromResolveEvent == null)
521  {
522  if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime)
523  {
524  return Type.GetType(typeName + ", " + assemblyString, throwOnError: true, ignoreCase: false);
525  }
526  assemblyFromResolveEvent = RuntimeAssembly.InternalLoadAssemblyName(assemblyName, null, null, ref stackMark, throwOnFileNotFound: true, forIntrospection: false, suppressSecurityChecks: false);
527  }
528  return assemblyFromResolveEvent.GetType(typeName, throwOnError: true, ignoreCase: false);
529  }
530 
544  [MethodImpl(MethodImplOptions.NoInlining)]
545  [SecuritySafeCritical]
546  public static Assembly ReflectionOnlyLoad(string assemblyString)
547  {
548  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
549  return RuntimeAssembly.InternalLoad(assemblyString, null, ref stackMark, forIntrospection: true);
550  }
551 
563  [MethodImpl(MethodImplOptions.NoInlining)]
564  [SecuritySafeCritical]
565  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
566  public static Assembly Load(string assemblyString, Evidence assemblySecurity)
567  {
568  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
569  return RuntimeAssembly.InternalLoad(assemblyString, assemblySecurity, ref stackMark, forIntrospection: false);
570  }
571 
583  [MethodImpl(MethodImplOptions.NoInlining)]
584  [SecuritySafeCritical]
585  [__DynamicallyInvokable]
586  public static Assembly Load(AssemblyName assemblyRef)
587  {
588  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
589  return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, null, null, ref stackMark, throwOnFileNotFound: true, forIntrospection: false, suppressSecurityChecks: false);
590  }
591 
603  [MethodImpl(MethodImplOptions.NoInlining)]
604  [SecuritySafeCritical]
605  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
606  public static Assembly Load(AssemblyName assemblyRef, Evidence assemblySecurity)
607  {
608  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
609  return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, assemblySecurity, null, ref stackMark, throwOnFileNotFound: true, forIntrospection: false, suppressSecurityChecks: false);
610  }
611 
618  [MethodImpl(MethodImplOptions.NoInlining)]
619  [SecuritySafeCritical]
620  [Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
621  public static Assembly LoadWithPartialName(string partialName)
622  {
623  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
624  return RuntimeAssembly.LoadWithPartialNameInternal(partialName, null, ref stackMark);
625  }
626 
635  [MethodImpl(MethodImplOptions.NoInlining)]
636  [SecuritySafeCritical]
637  [Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
638  public static Assembly LoadWithPartialName(string partialName, Evidence securityEvidence)
639  {
640  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
641  return RuntimeAssembly.LoadWithPartialNameInternal(partialName, securityEvidence, ref stackMark);
642  }
643 
651  [MethodImpl(MethodImplOptions.NoInlining)]
652  [SecuritySafeCritical]
653  public static Assembly Load(byte[] rawAssembly)
654  {
655  AppDomain.CheckLoadByteArraySupported();
656  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
657  return RuntimeAssembly.nLoadImage(rawAssembly, null, null, ref stackMark, fIntrospection: false, SecurityContextSource.CurrentAssembly);
658  }
659 
669  [MethodImpl(MethodImplOptions.NoInlining)]
670  [SecuritySafeCritical]
671  public static Assembly ReflectionOnlyLoad(byte[] rawAssembly)
672  {
673  AppDomain.CheckReflectionOnlyLoadSupported();
674  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
675  return RuntimeAssembly.nLoadImage(rawAssembly, null, null, ref stackMark, fIntrospection: true, SecurityContextSource.CurrentAssembly);
676  }
677 
686  [MethodImpl(MethodImplOptions.NoInlining)]
687  [SecuritySafeCritical]
688  public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore)
689  {
690  AppDomain.CheckLoadByteArraySupported();
691  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
692  return RuntimeAssembly.nLoadImage(rawAssembly, rawSymbolStore, null, ref stackMark, fIntrospection: false, SecurityContextSource.CurrentAssembly);
693  }
694 
707  [MethodImpl(MethodImplOptions.NoInlining)]
708  [SecuritySafeCritical]
709  public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore, SecurityContextSource securityContextSource)
710  {
711  AppDomain.CheckLoadByteArraySupported();
712  if (securityContextSource < SecurityContextSource.CurrentAppDomain || securityContextSource > SecurityContextSource.CurrentAssembly)
713  {
714  throw new ArgumentOutOfRangeException("securityContextSource");
715  }
716  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
717  return RuntimeAssembly.nLoadImage(rawAssembly, rawSymbolStore, null, ref stackMark, fIntrospection: false, securityContextSource);
718  }
719 
732  [MethodImpl(MethodImplOptions.NoInlining)]
733  [SecuritySafeCritical]
734  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
735  [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlEvidence)]
736  public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
737  {
738  AppDomain.CheckLoadByteArraySupported();
739  if (securityEvidence != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
740  {
741  Zone hostEvidence = securityEvidence.GetHostEvidence<Zone>();
742  if (hostEvidence == null || hostEvidence.SecurityZone != 0)
743  {
744  throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
745  }
746  }
747  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
748  return RuntimeAssembly.nLoadImage(rawAssembly, rawSymbolStore, securityEvidence, ref stackMark, fIntrospection: false, SecurityContextSource.CurrentAssembly);
749  }
750 
760  [SecuritySafeCritical]
761  public static Assembly LoadFile(string path)
762  {
763  AppDomain.CheckLoadFileSupported();
764  new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, path).Demand();
765  return RuntimeAssembly.nLoadFile(path, null);
766  }
767 
780  [SecuritySafeCritical]
781  [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFile which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
782  [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlEvidence)]
783  public static Assembly LoadFile(string path, Evidence securityEvidence)
784  {
785  AppDomain.CheckLoadFileSupported();
786  if (securityEvidence != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
787  {
788  throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
789  }
790  new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, path).Demand();
791  return RuntimeAssembly.nLoadFile(path, securityEvidence);
792  }
793 
796  [MethodImpl(MethodImplOptions.NoInlining)]
797  [SecuritySafeCritical]
798  [__DynamicallyInvokable]
800  {
801  StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
802  return RuntimeAssembly.GetExecutingAssembly(ref stackMark);
803  }
804 
807  [MethodImpl(MethodImplOptions.NoInlining)]
808  [SecuritySafeCritical]
809  [__DynamicallyInvokable]
810  public static Assembly GetCallingAssembly()
811  {
812  StackCrawlMark stackMark = StackCrawlMark.LookForMyCallersCaller;
813  return RuntimeAssembly.GetExecutingAssembly(ref stackMark);
814  }
815 
818  [SecuritySafeCritical]
819  public static Assembly GetEntryAssembly()
820  {
822  if (appDomainManager == null)
823  {
824  appDomainManager = new AppDomainManager();
825  }
826  return appDomainManager.EntryAssembly;
827  }
828 
831  [__DynamicallyInvokable]
832  public virtual AssemblyName GetName()
833  {
834  return GetName(copiedName: false);
835  }
836 
841  public virtual AssemblyName GetName(bool copiedName)
842  {
843  throw new NotImplementedException();
844  }
845 
849  {
850  return GetType();
851  }
852 
870  [__DynamicallyInvokable]
871  public virtual Type GetType(string name)
872  {
873  return GetType(name, throwOnError: false, ignoreCase: false);
874  }
875 
894  [__DynamicallyInvokable]
895  public virtual Type GetType(string name, bool throwOnError)
896  {
897  return GetType(name, throwOnError, ignoreCase: false);
898  }
899 
922  [__DynamicallyInvokable]
923  public virtual Type GetType(string name, bool throwOnError, bool ignoreCase)
924  {
925  throw new NotImplementedException();
926  }
927 
931  [__DynamicallyInvokable]
932  public virtual Type[] GetExportedTypes()
933  {
934  throw new NotImplementedException();
935  }
936 
940  [__DynamicallyInvokable]
941  public virtual Type[] GetTypes()
942  {
943  Module[] modules = GetModules(getResourceModules: false);
944  int num = modules.Length;
945  int num2 = 0;
946  Type[][] array = new Type[num][];
947  for (int i = 0; i < num; i++)
948  {
949  array[i] = modules[i].GetTypes();
950  num2 += array[i].Length;
951  }
952  int num3 = 0;
953  Type[] array2 = new Type[num2];
954  for (int j = 0; j < num; j++)
955  {
956  int num4 = array[j].Length;
957  Array.Copy(array[j], 0, array2, num3, num4);
958  num3 += num4;
959  }
960  return array2;
961  }
962 
975  [__DynamicallyInvokable]
976  public virtual Stream GetManifestResourceStream(Type type, string name)
977  {
978  throw new NotImplementedException();
979  }
980 
993  [__DynamicallyInvokable]
994  public virtual Stream GetManifestResourceStream(string name)
995  {
996  throw new NotImplementedException();
997  }
998 
1008  {
1009  throw new NotImplementedException();
1010  }
1011 
1021  public virtual Assembly GetSatelliteAssembly(CultureInfo culture, Version version)
1022  {
1023  throw new NotImplementedException();
1024  }
1025 
1031  [SecurityCritical]
1032  public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
1033  {
1034  throw new NotImplementedException();
1035  }
1036 
1040  [__DynamicallyInvokable]
1041  public virtual object[] GetCustomAttributes(bool inherit)
1042  {
1043  throw new NotImplementedException();
1044  }
1045 
1054  [__DynamicallyInvokable]
1055  public virtual object[] GetCustomAttributes(Type attributeType, bool inherit)
1056  {
1057  throw new NotImplementedException();
1058  }
1059 
1069  [__DynamicallyInvokable]
1070  public virtual bool IsDefined(Type attributeType, bool inherit)
1071  {
1072  throw new NotImplementedException();
1073  }
1074 
1078  {
1079  throw new NotImplementedException();
1080  }
1081 
1093  public Module LoadModule(string moduleName, byte[] rawModule)
1094  {
1095  return LoadModule(moduleName, rawModule, null);
1096  }
1097 
1110  public virtual Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore)
1111  {
1112  throw new NotImplementedException();
1113  }
1114 
1130  public object CreateInstance(string typeName)
1131  {
1132  return CreateInstance(typeName, ignoreCase: false, BindingFlags.Instance | BindingFlags.Public, null, null, null, null);
1133  }
1134 
1152  public object CreateInstance(string typeName, bool ignoreCase)
1153  {
1154  return CreateInstance(typeName, ignoreCase, BindingFlags.Instance | BindingFlags.Public, null, null, null, null);
1155  }
1156 
1180  public virtual object CreateInstance(string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
1181  {
1182  Type type = GetType(typeName, throwOnError: false, ignoreCase);
1183  if (type == null)
1184  {
1185  return null;
1186  }
1187  return Activator.CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
1188  }
1189 
1193  {
1194  return GetLoadedModules(getResourceModules: false);
1195  }
1196 
1201  public virtual Module[] GetLoadedModules(bool getResourceModules)
1202  {
1203  throw new NotImplementedException();
1204  }
1205 
1209  [__DynamicallyInvokable]
1210  public Module[] GetModules()
1211  {
1212  return GetModules(getResourceModules: false);
1213  }
1214 
1219  public virtual Module[] GetModules(bool getResourceModules)
1220  {
1221  throw new NotImplementedException();
1222  }
1223 
1234  public virtual Module GetModule(string name)
1235  {
1236  throw new NotImplementedException();
1237  }
1238 
1249  public virtual FileStream GetFile(string name)
1250  {
1251  throw new NotImplementedException();
1252  }
1253 
1259  public virtual FileStream[] GetFiles()
1260  {
1261  return GetFiles(getResourceModules: false);
1262  }
1263 
1271  public virtual FileStream[] GetFiles(bool getResourceModules)
1272  {
1273  throw new NotImplementedException();
1274  }
1275 
1278  [__DynamicallyInvokable]
1279  public virtual string[] GetManifestResourceNames()
1280  {
1281  throw new NotImplementedException();
1282  }
1283 
1287  {
1288  throw new NotImplementedException();
1289  }
1290 
1297  [__DynamicallyInvokable]
1298  public virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
1299  {
1300  throw new NotImplementedException();
1301  }
1302 
1305  [__DynamicallyInvokable]
1306  public override string ToString()
1307  {
1308  string fullName = FullName;
1309  if (fullName == null)
1310  {
1311  return base.ToString();
1312  }
1313  return fullName;
1314  }
1315  }
1316 }
static Assembly GetExecutingAssembly()
Gets the assembly that contains the code that is currently executing.
Definition: Assembly.cs:799
Performs reflection on a module.
Definition: Module.cs:17
virtual Assembly Assembly
Gets the appropriate T:System.Reflection.Assembly for this instance of T:System.Reflection....
Definition: Module.cs:133
bool IsUnrestricted()
Determines whether the T:System.Security.PermissionSet is Unrestricted.
AssemblyContentType
Provides information about the type of code contained in an assembly.
static Assembly LoadWithPartialName(string partialName, Evidence securityEvidence)
Loads an assembly from the application directory or from the global assembly cache using a partial na...
Definition: Assembly.cs:638
static Assembly ReflectionOnlyLoad(string assemblyString)
Loads an assembly into the reflection-only context, given its display name.
Definition: Assembly.cs:546
static Assembly GetAssembly(Type type)
Gets the currently loaded assembly in which the specified type is defined.
Definition: Assembly.cs:292
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Module [] GetModules()
Gets all the modules that are part of this assembly.
Definition: Assembly.cs:1210
Describes a set of security permissions applied to code. This class cannot be inherited.
FileIOPermissionAccess
Specifies the type of file access requested.
Gets an object's T:System.Security.Policy.Evidence.
static Assembly ReflectionOnlyLoadFrom(string assemblyFile)
Loads an assembly into the reflection-only context, given its path.
Definition: Assembly.cs:392
static Assembly LoadFile(string path)
Loads the contents of an assembly file on the specified path.
Definition: Assembly.cs:761
virtual AssemblyName GetName(bool copiedName)
Gets an T:System.Reflection.AssemblyName for this assembly, setting the codebase as specified by copi...
Definition: Assembly.cs:841
virtual long HostContext
Gets the host context with which the assembly was loaded.
Definition: Assembly.cs:238
static Assembly Load(string assemblyString)
Loads an assembly given the long form of its name.
Definition: Assembly.cs:507
virtual string ImageRuntimeVersion
Gets a string representing the version of the common language runtime (CLR) saved in the file contain...
Definition: Assembly.cs:216
Discovers the attributes of a method and provides access to method metadata.
Definition: MethodInfo.cs:13
abstract string FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
Definition: Type.cs:153
static Assembly LoadFile(string path, Evidence securityEvidence)
Loads an assembly given its path, loading the assembly into the domain of the caller using the suppli...
Definition: Assembly.cs:783
virtual bool IsDefined(Type attributeType, bool inherit)
Indicates whether or not a specified attribute has been applied to the assembly.
Definition: Assembly.cs:1070
virtual Type GetType(string name)
Gets the T:System.Type object with the specified name in the assembly instance.
Definition: Assembly.cs:871
virtual object [] GetCustomAttributes(Type attributeType, bool inherit)
Gets the custom attributes for this assembly as specified by type.
Definition: Assembly.cs:1055
virtual string FullName
Gets the display name of the assembly.
Definition: Assembly.cs:49
static Assembly GetCallingAssembly()
Returns the T:System.Reflection.Assembly of the method that invoked the currently executing method.
Definition: Assembly.cs:810
Provides the security zone of a code assembly as evidence for policy evaluation. This class cannot be...
Definition: Zone.cs:10
virtual AssemblyName GetName()
Gets an T:System.Reflection.AssemblyName for this assembly.
Definition: Assembly.cs:832
virtual string EscapedCodeBase
Gets the URI, including escape characters, that represents the codebase.
Definition: Assembly.cs:37
BindingFlags
Specifies flags that control binding and the way in which the search for members and types is conduct...
Definition: BindingFlags.cs:10
virtual ModuleResolveEventHandler ModuleResolve
Occurs when the common language runtime class loader cannot resolve a reference to an internal module...
Definition: Assembly.cs:265
Definition: __Canon.cs:3
The exception that is thrown when the value of an argument is outside the allowable range of values a...
virtual IEnumerable< Module > Modules
Gets a collection that contains the modules in this assembly.
Definition: Assembly.cs:193
AssemblyContentType ContentType
Gets or sets a value that indicates what type of content the assembly contains.
object CreateInstance(string typeName)
Locates the specified type from this assembly and creates an instance of it using the system activato...
Definition: Assembly.cs:1130
Module LoadModule(string moduleName, byte[] rawModule)
Loads the module, internal to this assembly, with a common object file format (COFF)-based image cont...
Definition: Assembly.cs:1093
static string CreateQualifiedName(string assemblyName, string typeName)
Creates the name of a type qualified by the display name of its assembly.
Definition: Assembly.cs:282
SecurityContextSource
Identifies the source for the security context.
virtual IEnumerable< TypeInfo > DefinedTypes
Gets a collection of the types defined in this assembly.
Definition: Assembly.cs:85
virtual IEnumerable< CustomAttributeData > CustomAttributes
Gets a collection that contains this assembly's custom attributes.
Definition: Assembly.cs:169
static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore, SecurityContextSource securityContextSource)
Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly...
Definition: Assembly.cs:709
static Assembly GetEntryAssembly()
Gets the process executable in the default application domain. In other application domains,...
Definition: Assembly.cs:819
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
static Assembly UnsafeLoadFrom(string assemblyFile)
Loads an assembly into the load-from context, bypassing some security checks.
Definition: Assembly.cs:486
virtual object CreateInstance(string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
Locates the specified type from this assembly and creates an instance of it using the system activato...
Definition: Assembly.cs:1180
virtual AssemblyName [] GetReferencedAssemblies()
Gets the T:System.Reflection.AssemblyName objects for all the assemblies referenced by this assembly.
Definition: Assembly.cs:1286
virtual FileStream [] GetFiles()
Gets the files in the file table of an assembly manifest.
Definition: Assembly.cs:1259
Describes the source and destination of a given serialized stream, and provides an additional caller-...
static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence)
Loads an assembly given its file name or path and supplying security evidence.
Definition: Assembly.cs:415
static AppDomain CurrentDomain
Gets the current application domain for the current T:System.Threading.Thread.
Definition: AppDomain.cs:274
virtual Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore)
Loads the module, internal to this assembly, with a common object file format (COFF)-based image cont...
Definition: Assembly.cs:1110
virtual object [] GetCustomAttributes(bool inherit)
Gets all the custom attributes for this assembly.
Definition: Assembly.cs:1041
Represents an application domain, which is an isolated environment where applications execute....
Definition: AppDomain.cs:33
Represents type declarations for class types, interface types, array types, value types,...
Definition: TypeInfo.cs:11
virtual Assembly GetSatelliteAssembly(CultureInfo culture, Version version)
Gets the specified version of the satellite assembly for the specified culture.
Definition: Assembly.cs:1021
override int GetHashCode()
Returns the hash code for this instance.
Definition: Assembly.cs:349
Exposes the public members of the T:System.Reflection.Assembly class to unmanaged code.
Definition: _Assembly.cs:16
new Type GetType()
Provides COM objects with version-independent access to the M:System.Object.GetType method.
override string ToString()
Returns the full name of the assembly, also known as the display name.
Definition: Assembly.cs:1306
virtual Type [] GetExportedTypes()
Gets the public types defined in this assembly that are visible outside the assembly.
Definition: Assembly.cs:932
Contains methods to create types of objects locally or remotely, or obtain references to existing rem...
Definition: Activator.cs:21
virtual Module ManifestModule
Gets the module that contains the manifest for the current assembly.
Definition: Assembly.cs:152
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore)
Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly...
Definition: Assembly.cs:688
static Assembly LoadFrom(string assemblyFile, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
Loads an assembly given its file name or path, hash value, and hash algorithm.
Definition: Assembly.cs:464
virtual string CodeBase
Gets the location of the assembly as specified originally, for example, in an T:System....
Definition: Assembly.cs:27
Represents a collection that can contain many different types of permissions.
object CreateInstance(string typeName, bool ignoreCase)
Locates the specified type from this assembly and creates an instance of it using the system activato...
Definition: Assembly.cs:1152
virtual Stream GetManifestResourceStream(Type type, string name)
Loads the specified manifest resource, scoped by the namespace of the specified type,...
Definition: Assembly.cs:976
Provides a T:System.IO.Stream for a file, supporting both synchronous and asynchronous read and write...
Definition: FileStream.cs:15
virtual Module [] GetModules(bool getResourceModules)
Gets all the modules that are part of this assembly, specifying whether to include resource modules.
Definition: Assembly.cs:1219
Represents an assembly, which is a reusable, versionable, and self-describing building block of a com...
Definition: Assembly.cs:22
virtual bool GlobalAssemblyCache
Gets a value indicating whether the assembly was loaded from the global assembly cache.
Definition: Assembly.cs:227
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition: Array.cs:17
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
virtual Module GetModule(string name)
Gets the specified module in this assembly.
Definition: Assembly.cs:1234
Represents the version number of an assembly, operating system, or the common language runtime....
Definition: Version.cs:11
override bool Equals(object o)
Determines whether this assembly and the specified object are equal.
Definition: Assembly.cs:341
Provides access to manifest resources, which are XML files that describe application dependencies.
static bool operator==(Assembly left, Assembly right)
Indicates whether two T:System.Reflection.Assembly objects are equal.
Definition: Assembly.cs:312
MethodImplOptions
Defines the details of how a method is implemented.
virtual Type [] GetTypes()
Gets the types defined in this assembly.
Definition: Assembly.cs:941
static Assembly Load(byte[] rawAssembly)
Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly...
Definition: Assembly.cs:653
static Assembly Load(AssemblyName assemblyRef)
Loads an assembly given its T:System.Reflection.AssemblyName.
Definition: Assembly.cs:586
Module [] GetLoadedModules()
Gets all the loaded modules that are part of this assembly.
Definition: Assembly.cs:1192
Selects a member from a list of candidates, and performs type conversion from actual argument type to...
Definition: Binder.cs:10
static Assembly LoadFrom(string assemblyFile)
Loads an assembly given its file name or path.
Definition: Assembly.cs:369
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
virtual IList< CustomAttributeData > GetCustomAttributesData()
Returns information about the attributes that have been applied to the current T:System....
Definition: Assembly.cs:1077
Provides a managed equivalent of an unmanaged host.
virtual FileStream GetFile(string name)
Gets a T:System.IO.FileStream for the specified file in the file table of the manifest of this assemb...
Definition: Assembly.cs:1249
Describes an assembly's unique identity in full.
Definition: AssemblyName.cs:19
virtual MethodInfo EntryPoint
Gets the entry point of this assembly.
Definition: Assembly.cs:61
Represents a collection of objects that can be individually accessed by index.
Definition: IList.cs:9
SecurityRuleSet
Identifies the set of security rules the common language runtime should enforce for an assembly.
static object CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture)
Creates an instance of the specified type using the constructor that best matches the specified param...
Definition: Activator.cs:57
void Demand()
Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have...
virtual Assembly GetSatelliteAssembly(CultureInfo culture)
Gets the satellite assembly for the specified culture.
Definition: Assembly.cs:1007
virtual Stream GetManifestResourceStream(string name)
Loads the specified manifest resource from this assembly.
Definition: Assembly.cs:994
virtual string Location
Gets the full path or UNC location of the loaded file that contains the manifest.
Definition: Assembly.cs:205
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
Definition: Array.cs:1275
Allows an object to control its own serialization and deserialization.
Definition: ISerializable.cs:8
virtual Type GetType(string name, bool throwOnError)
Gets the T:System.Type object with the specified name in the assembly instance and optionally throws ...
Definition: Assembly.cs:895
static Assembly LoadWithPartialName(string partialName)
Loads an assembly from the application directory or from the global assembly cache using a partial na...
Definition: Assembly.cs:621
virtual Assembly EntryAssembly
Gets the entry assembly for an application.
static Assembly Load(AssemblyName assemblyRef, Evidence assemblySecurity)
Loads an assembly given its T:System.Reflection.AssemblyName. The assembly is loaded into the domain ...
Definition: Assembly.cs:606
Defines the set of information that constitutes input to security policy decisions....
Definition: Evidence.cs:17
virtual Type [] GetTypes()
Returns all the types defined within this module.
Definition: Module.cs:561
static Assembly ReflectionOnlyLoad(byte[] rawAssembly)
Loads the assembly from a common object file format (COFF)-based image containing an emitted assembly...
Definition: Assembly.cs:671
AppDomainManager DomainManager
Gets the domain manager that was provided by the host when the application domain was initialized.
Definition: AppDomain.cs:245
Specifies that the class can be serialized.
static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
Loads an assembly given its file name or path, security evidence, hash value, and hash algorithm.
Definition: Assembly.cs:440
virtual bool ReflectionOnly
Gets a T:System.Boolean value indicating whether this assembly was loaded into the reflection-only co...
Definition: Assembly.cs:182
static bool operator !=(Assembly left, Assembly right)
Indicates whether two T:System.Reflection.Assembly objects are not equal.
Definition: Assembly.cs:331
static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Gets the T:System.Type with the specified name, specifying whether to throw an exception if the type ...
Definition: Type.cs:853
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
virtual Type GetType(string name, bool throwOnError, bool ignoreCase)
Gets the T:System.Type object with the specified name in the assembly instance, with the options of i...
Definition: Assembly.cs:923
virtual IEnumerable< Type > ExportedTypes
Gets a collection of the public types defined in this assembly that are visible outside the assembly.
Definition: Assembly.cs:73
abstract new Module Module
Gets the module (the DLL) in which the current T:System.Type is defined.
Definition: Type.cs:123
static Assembly Load(string assemblyString, Evidence assemblySecurity)
Loads an assembly given its display name, loading the assembly into the domain of the caller using th...
Definition: Assembly.cs:566
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Controls the ability to access files and folders. This class cannot be inherited.
SecurityZone SecurityZone
Gets the zone from which the code assembly originates.
Definition: Zone.cs:30
SecurityPermissionFlag
Specifies access flags for the security permission object.
virtual bool IsDynamic
Gets a value that indicates whether the current assembly was generated dynamically in the current pro...
Definition: Assembly.cs:255
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Gets serialization information with all of the data needed to reinstantiate this assembly.
Definition: Assembly.cs:1032
static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly...
Definition: Assembly.cs:736
virtual FileStream [] GetFiles(bool getResourceModules)
Gets the files in the file table of an assembly manifest, specifying whether to include resource modu...
Definition: Assembly.cs:1271
The exception that is thrown when a requested method or operation is not implemented.
bool IsFullyTrusted
Gets a value that indicates whether the current assembly is loaded with full trust.
Definition: Assembly.cs:129
Provides custom attributes for reflection objects that support them.
AssemblyHashAlgorithm
Specifies all the hash algorithms used for hashing files and for generating the strong name.
delegate Module ModuleResolveEventHandler(object sender, ResolveEventArgs e)
Represents the method that will handle the E:System.Reflection.Assembly.ModuleResolve event of an T:S...
virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
Returns information about how the given resource has been persisted.
Definition: Assembly.cs:1298
virtual string [] GetManifestResourceNames()
Returns the names of all the resources in this assembly.
Definition: Assembly.cs:1279
virtual Module [] GetLoadedModules(bool getResourceModules)
Gets all the loaded modules that are part of this assembly, specifying whether to include resource mo...
Definition: Assembly.cs:1201
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the ....
Definition: Stream.cs:16