2 // System.Reflection/Assembly.cs
5 // Paolo Molaro (lupus@ximian.com)
7 // (C) 2001 Ximian, Inc. http://www.ximian.com
8 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
9 // Copyright 2011 Xamarin Inc (http://www.xamarin.com).
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Security;
32 using System.Security.Policy;
33 using System.Security.Permissions;
34 using System.Runtime.Serialization;
35 using System.Reflection;
37 using System.Globalization;
38 using System.Runtime.CompilerServices;
39 using System.Runtime.InteropServices;
40 using System.Collections.Generic;
41 using System.Configuration.Assemblies;
45 namespace System.Reflection {
48 [ComDefaultInterfaceAttribute (typeof (_Assembly))]
50 [ClassInterface(ClassInterfaceType.None)]
51 [StructLayout (LayoutKind.Sequential)]
53 public partial class Assembly : ICustomAttributeProvider {
55 public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
57 internal class ResolveEventHolder {
58 public event ModuleResolveEventHandler ModuleResolve;
61 internal class UnmanagedMemoryStreamForModule : UnmanagedMemoryStream
65 public unsafe UnmanagedMemoryStreamForModule (byte* pointer, long length, Module module)
66 : base (pointer, length)
71 protected override void Dispose (bool disposing)
75 * The returned pointer points inside metadata, so
76 * we have to increase the refcount of the module, and decrease
77 * it when the stream is finalized.
82 base.Dispose (disposing);
86 // Note: changes to fields must be reflected in _MonoReflectionAssembly struct (object-internals.h)
87 #pragma warning disable 649
88 private IntPtr _mono_assembly;
89 #pragma warning restore 649
91 private ResolveEventHolder resolve_event_holder;
93 private Evidence _evidence;
94 internal PermissionSet _minimum; // for SecurityAction.RequestMinimum
95 internal PermissionSet _optional; // for SecurityAction.RequestOptional
96 internal PermissionSet _refuse; // for SecurityAction.RequestRefuse
97 private PermissionSet _granted; // for the resolved assembly granted permissions
98 private PermissionSet _denied; // for the resolved assembly denied permissions
100 object _evidence, _minimum, _optional, _refuse, _granted, _denied;
102 private bool fromByteArray;
103 private string assemblyName;
108 resolve_event_holder = new ResolveEventHolder ();
112 // We can't store the event directly in this class, since the
113 // compiler would silently insert the fields before _mono_assembly
115 public event ModuleResolveEventHandler ModuleResolve {
116 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
118 resolve_event_holder.ModuleResolve += value;
120 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
122 resolve_event_holder.ModuleResolve -= value;
126 [MethodImplAttribute (MethodImplOptions.InternalCall)]
127 private extern string get_code_base (bool escaped);
129 [MethodImplAttribute (MethodImplOptions.InternalCall)]
130 private extern string get_fullname ();
132 [MethodImplAttribute (MethodImplOptions.InternalCall)]
133 private extern string get_location ();
135 [MethodImplAttribute (MethodImplOptions.InternalCall)]
136 private extern string InternalImageRuntimeVersion ();
138 // SECURITY: this should be the only caller to icall get_code_base
139 private string GetCodeBase (bool escaped)
141 string cb = get_code_base (escaped);
143 if (SecurityManager.SecurityEnabled) {
144 // we cannot divulge local file informations
145 if (String.Compare ("FILE://", 0, cb, 0, 7, true, CultureInfo.InvariantCulture) == 0) {
146 string file = cb.Substring (7);
147 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, file).Demand ();
154 public virtual string CodeBase {
155 get { return GetCodeBase (false); }
158 public virtual string EscapedCodeBase {
159 get { return GetCodeBase (true); }
162 public virtual string FullName {
165 // FIXME: This is wrong, but it gets us going
166 // in the compiler for now
172 public virtual extern MethodInfo EntryPoint {
173 [MethodImplAttribute (MethodImplOptions.InternalCall)]
177 public virtual Evidence Evidence {
178 [SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
179 get { return UnprotectedGetEvidence (); }
182 // note: the security runtime requires evidences but may be unable to do so...
183 internal Evidence UnprotectedGetEvidence ()
188 // if the host (runtime) hasn't provided it's own evidence...
189 if (_evidence == null) {
190 // ... we will provide our own
192 _evidence = Evidence.GetDefaultHostEvidence (this);
199 [MethodImplAttribute (MethodImplOptions.InternalCall)]
200 internal extern bool get_global_assembly_cache ();
202 internal bool FromByteArray {
203 set { fromByteArray = value; }
206 public virtual String Location {
211 string loc = get_location ();
213 if ((loc != String.Empty) && SecurityManager.SecurityEnabled) {
214 // we cannot divulge local file informations
215 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, loc).Demand ();
223 public virtual string ImageRuntimeVersion {
225 return InternalImageRuntimeVersion ();
229 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
231 throw new NotImplementedException ();
234 public virtual bool IsDefined (Type attributeType, bool inherit)
236 return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
239 public virtual object [] GetCustomAttributes (bool inherit)
241 return MonoCustomAttrs.GetCustomAttributes (this, inherit);
244 public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
246 return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
249 [MethodImplAttribute (MethodImplOptions.InternalCall)]
250 private extern object GetFilesInternal (String name, bool getResourceModules);
252 public virtual FileStream[] GetFiles ()
254 return GetFiles (false);
257 public virtual FileStream [] GetFiles (bool getResourceModules)
259 string[] names = (string[]) GetFilesInternal (null, getResourceModules);
261 return EmptyArray<FileStream>.Value;
263 string location = Location;
266 if (location != String.Empty) {
267 res = new FileStream [names.Length + 1];
268 res [0] = new FileStream (location, FileMode.Open, FileAccess.Read);
269 for (int i = 0; i < names.Length; ++i)
270 res [i + 1] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
272 res = new FileStream [names.Length];
273 for (int i = 0; i < names.Length; ++i)
274 res [i] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
279 public virtual FileStream GetFile (String name)
282 throw new ArgumentNullException (null, "Name cannot be null.");
283 if (name.Length == 0)
284 throw new ArgumentException ("Empty name is not valid");
286 string filename = (string)GetFilesInternal (name, true);
287 if (filename != null)
288 return new FileStream (filename, FileMode.Open, FileAccess.Read);
293 [MethodImplAttribute (MethodImplOptions.InternalCall)]
294 internal extern IntPtr GetManifestResourceInternal (String name, out int size, out Module module);
296 public virtual Stream GetManifestResourceStream (String name)
299 throw new ArgumentNullException ("name");
300 if (name.Length == 0)
301 throw new ArgumentException ("String cannot have zero length.",
304 ManifestResourceInfo info = GetManifestResourceInfo (name);
306 Assembly a = AppDomain.CurrentDomain.DoResourceResolve (name, this);
307 if (a != null && a != this)
308 return a.GetManifestResourceStream (name);
313 if (info.ReferencedAssembly != null)
314 return info.ReferencedAssembly.GetManifestResourceStream (name);
315 if ((info.FileName != null) && (info.ResourceLocation == 0)) {
317 throw new FileNotFoundException (info.FileName);
319 string location = Path.GetDirectoryName (Location);
320 string filename = Path.Combine (location, info.FileName);
321 return new FileStream (filename, FileMode.Open, FileAccess.Read);
326 IntPtr data = GetManifestResourceInternal (name, out size, out module);
327 if (data == (IntPtr) 0)
330 UnmanagedMemoryStream stream;
332 stream = new UnmanagedMemoryStreamForModule ((byte*) data, size, module);
338 public virtual Stream GetManifestResourceStream (Type type, String name)
345 throw new ArgumentNullException ("type");
349 if (ns == null || ns.Length == 0)
350 return GetManifestResourceStream (name);
352 return GetManifestResourceStream (ns + "." + name);
355 [MethodImplAttribute (MethodImplOptions.InternalCall)]
356 internal virtual extern Type[] GetTypes (bool exportedOnly);
358 public virtual Type[] GetTypes ()
360 return GetTypes (false);
363 public virtual Type[] GetExportedTypes ()
365 return GetTypes (true);
368 public virtual Type GetType (String name, Boolean throwOnError)
370 return GetType (name, throwOnError, false);
373 public virtual Type GetType (String name) {
374 return GetType (name, false, false);
377 [MethodImplAttribute (MethodImplOptions.InternalCall)]
378 internal extern Type InternalGetType (Module module, String name, Boolean throwOnError, Boolean ignoreCase);
380 [MethodImplAttribute (MethodImplOptions.InternalCall)]
381 internal extern static void InternalGetAssemblyName (string assemblyFile, AssemblyName aname);
383 [MethodImplAttribute (MethodImplOptions.InternalCall)]
384 static extern void FillName (Assembly ass, AssemblyName aname);
386 [MonoTODO ("copiedName == true is not supported")]
387 public virtual AssemblyName GetName (Boolean copiedName)
390 // CodeBase, which is restricted, will be copied into the AssemblyName object so...
391 if (SecurityManager.SecurityEnabled) {
392 GetCodeBase (true); // this will ensure the Demand is made
395 return UnprotectedGetName ();
398 public virtual AssemblyName GetName ()
400 return GetName (false);
403 // the security runtime requires access to the assemblyname (e.g. to get the strongname)
404 internal virtual AssemblyName UnprotectedGetName ()
406 AssemblyName aname = new AssemblyName ();
407 FillName (this, aname);
411 public override string ToString ()
413 // note: ToString work without requiring CodeBase (so no checks are needed)
415 if (assemblyName != null)
418 assemblyName = get_fullname ();
422 public static String CreateQualifiedName (String assemblyName, String typeName)
424 return typeName + ", " + assemblyName;
427 public static Assembly GetAssembly (Type type)
430 return type.Assembly;
431 throw new ArgumentNullException ("type");
435 [MethodImplAttribute (MethodImplOptions.InternalCall)]
436 public static extern Assembly GetEntryAssembly();
438 internal Assembly GetSatelliteAssemblyNoThrow (CultureInfo culture, Version version)
440 return GetSatelliteAssembly (culture, version, false);
443 internal Assembly GetSatelliteAssembly (CultureInfo culture, Version version, bool throwOnError)
446 throw new ArgumentException ("culture");
448 AssemblyName aname = GetName (true);
450 aname.Version = version;
452 aname.CultureInfo = culture;
453 aname.Name = aname.Name + ".resources";
457 assembly = AppDomain.CurrentDomain.LoadSatellite (aname, false);
458 if (assembly != null)
460 } catch (FileNotFoundException) {
465 // Try the assembly directory
466 string location = Path.GetDirectoryName (Location);
467 string fullName = Path.Combine (location, Path.Combine (culture.Name, aname.Name + ".dll"));
468 if (!throwOnError && !File.Exists (fullName))
471 return LoadFrom (fullName);
475 Type _Assembly.GetType ()
477 // Required or object::GetType becomes virtual final
478 return base.GetType ();
482 [MethodImplAttribute (MethodImplOptions.InternalCall)]
483 private extern static Assembly LoadFrom (String assemblyFile, bool refonly);
485 public static Assembly LoadFrom (String assemblyFile)
487 return LoadFrom (assemblyFile, false);
491 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
493 Assembly a = LoadFrom (assemblyFile, false);
495 if ((a != null) && (securityEvidence != null)) {
496 // merge evidence (i.e. replace defaults with provided evidences)
497 a.Evidence.Merge (securityEvidence);
504 [MonoTODO("This overload is not currently implemented")]
505 // FIXME: What are we missing?
506 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
508 throw new NotImplementedException ();
512 public static Assembly LoadFrom (String assemblyFile, byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm)
514 throw new NotImplementedException ();
517 public static Assembly UnsafeLoadFrom (String assemblyFile)
519 return LoadFrom (assemblyFile);
523 public static Assembly LoadFile (String path, Evidence securityEvidence)
526 throw new ArgumentNullException ("path");
527 if (path == String.Empty)
528 throw new ArgumentException ("Path can't be empty", "path");
529 // FIXME: Make this do the right thing
530 return LoadFrom (path, securityEvidence);
533 public static Assembly LoadFile (String path)
535 return LoadFile (path, null);
538 public static Assembly Load (String assemblyString)
540 return AppDomain.CurrentDomain.Load (assemblyString);
544 public static Assembly Load (String assemblyString, Evidence assemblySecurity)
546 return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
549 public static Assembly Load (AssemblyName assemblyRef)
551 return AppDomain.CurrentDomain.Load (assemblyRef);
555 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
557 return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
560 public static Assembly Load (Byte[] rawAssembly)
562 return AppDomain.CurrentDomain.Load (rawAssembly);
565 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
567 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
571 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
572 Evidence securityEvidence)
574 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
577 [MonoLimitation ("Argument securityContextSource is ignored")]
578 public static Assembly Load (byte [] rawAssembly, byte [] rawSymbolStore, SecurityContextSource securityContextSource)
580 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
583 public static Assembly ReflectionOnlyLoad (byte[] rawAssembly)
585 return AppDomain.CurrentDomain.Load (rawAssembly, null, null, true);
588 public static Assembly ReflectionOnlyLoad (string assemblyString)
590 return AppDomain.CurrentDomain.Load (assemblyString, null, true);
593 public static Assembly ReflectionOnlyLoadFrom (string assemblyFile)
595 if (assemblyFile == null)
596 throw new ArgumentNullException ("assemblyFile");
598 return LoadFrom (assemblyFile, true);
602 public static Assembly LoadWithPartialName (string partialName)
604 return LoadWithPartialName (partialName, null);
607 [MonoTODO ("Not implemented")]
608 public Module LoadModule (string moduleName, byte [] rawModule)
610 throw new NotImplementedException ();
613 [MonoTODO ("Not implemented")]
616 Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
618 throw new NotImplementedException ();
621 [MethodImplAttribute (MethodImplOptions.InternalCall)]
622 private static extern Assembly load_with_partial_name (string name, Evidence e);
625 public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
627 return LoadWithPartialName (partialName, securityEvidence, true);
631 * LAMESPEC: It is possible for this method to throw exceptions IF the name supplied
632 * is a valid gac name and contains filesystem entry charachters at the end of the name
633 * ie System/// will throw an exception. However ////System will not as that is canocolized
637 // FIXME: LoadWithPartialName must look cache (no CAS) or read from disk (CAS)
638 internal static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
641 throw new NotImplementedException ();
643 if (partialName == null)
644 throw new NullReferenceException ();
646 return load_with_partial_name (partialName, securityEvidence);
649 public Object CreateInstance (String typeName)
651 return CreateInstance (typeName, false);
654 public Object CreateInstance (String typeName, Boolean ignoreCase)
656 Type t = GetType (typeName, false, ignoreCase);
661 return Activator.CreateInstance (t);
662 } catch (InvalidOperationException) {
663 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
669 Object CreateInstance (String typeName, Boolean ignoreCase,
670 BindingFlags bindingAttr, Binder binder,
671 Object[] args, CultureInfo culture,
672 Object[] activationAttributes)
674 Type t = GetType (typeName, false, ignoreCase);
679 return Activator.CreateInstance (t, bindingAttr, binder, args, culture, activationAttributes);
680 } catch (InvalidOperationException) {
681 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
685 public Module[] GetLoadedModules ()
687 return GetLoadedModules (false);
690 public Module[] GetModules ()
692 return GetModules (false);
695 [MethodImplAttribute (MethodImplOptions.InternalCall)]
696 internal virtual extern Module[] GetModulesInternal ();
698 [MethodImplAttribute (MethodImplOptions.InternalCall)]
699 public extern virtual String[] GetManifestResourceNames ();
701 [MethodImplAttribute (MethodImplOptions.InternalCall)]
702 public extern static Assembly GetExecutingAssembly ();
704 [MethodImplAttribute (MethodImplOptions.InternalCall)]
705 public extern static Assembly GetCallingAssembly ();
707 [MethodImplAttribute (MethodImplOptions.InternalCall)]
708 internal static extern AssemblyName[] GetReferencedAssemblies (Assembly module);
710 [MethodImplAttribute (MethodImplOptions.InternalCall)]
711 private extern bool GetManifestResourceInfoInternal (String name, ManifestResourceInfo info);
713 public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
715 if (resourceName == null)
716 throw new ArgumentNullException ("resourceName");
717 if (resourceName.Length == 0)
718 throw new ArgumentException ("String cannot have zero length.");
719 ManifestResourceInfo result = new ManifestResourceInfo ();
720 bool found = GetManifestResourceInfoInternal (resourceName, result);
727 [MonoTODO ("Currently it always returns zero")]
736 internal virtual Module GetManifestModule () {
737 return GetManifestModuleInternal ();
740 [MethodImplAttribute (MethodImplOptions.InternalCall)]
741 internal extern Module GetManifestModuleInternal ();
744 public virtual extern bool ReflectionOnly {
745 [MethodImplAttribute (MethodImplOptions.InternalCall)]
749 public override int GetHashCode ()
751 return base.GetHashCode ();
754 public override bool Equals (object o)
756 if (((object) this) == o)
762 Assembly other = (Assembly) o;
763 return other._mono_assembly == _mono_assembly;
767 // Code Access Security
769 internal void Resolve ()
772 // FIXME: As we (currently) delay the resolution until the first CAS
773 // Demand it's too late to evaluate the Minimum permission set as a
774 // condition to load the assembly into the AppDomain
775 LoadAssemblyPermissions ();
776 Evidence e = new Evidence (UnprotectedGetEvidence ()); // we need a copy to add PRE
777 e.AddHost (new PermissionRequestEvidence (_minimum, _optional, _refuse));
778 _granted = SecurityManager.ResolvePolicy (e,
779 _minimum, _optional, _refuse, out _denied);
783 internal PermissionSet GrantedPermissionSet {
785 if (_granted == null) {
786 if (SecurityManager.ResolvingPolicyLevel != null) {
787 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
788 return DefaultPolicies.FullTrust;
790 return null; // we can't resolve during resolution
798 internal PermissionSet DeniedPermissionSet {
800 // yes we look for granted, as denied may be null
801 if (_granted == null) {
802 if (SecurityManager.ResolvingPolicyLevel != null) {
803 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
806 return DefaultPolicies.FullTrust; // deny unrestricted
814 [MethodImplAttribute (MethodImplOptions.InternalCall)]
815 extern internal static bool LoadPermissions (Assembly a,
816 ref IntPtr minimum, ref int minLength,
817 ref IntPtr optional, ref int optLength,
818 ref IntPtr refused, ref int refLength);
820 // Support for SecurityAction.RequestMinimum, RequestOptional and RequestRefuse
821 private void LoadAssemblyPermissions ()
823 IntPtr minimum = IntPtr.Zero, optional = IntPtr.Zero, refused = IntPtr.Zero;
824 int minLength = 0, optLength = 0, refLength = 0;
825 if (LoadPermissions (this, ref minimum, ref minLength, ref optional,
826 ref optLength, ref refused, ref refLength)) {
828 // Note: no need to cache these permission sets as they will only be created once
829 // at assembly resolution time.
831 byte[] data = new byte [minLength];
832 Marshal.Copy (minimum, data, 0, minLength);
833 _minimum = SecurityManager.Decode (data);
836 byte[] data = new byte [optLength];
837 Marshal.Copy (optional, data, 0, optLength);
838 _optional = SecurityManager.Decode (data);
841 byte[] data = new byte [refLength];
842 Marshal.Copy (refused, data, 0, refLength);
843 _refuse = SecurityManager.Decode (data);
848 public virtual PermissionSet PermissionSet {
849 get { return this.GrantedPermissionSet; }
852 public virtual SecurityRuleSet SecurityRuleSet {
853 get { throw CreateNIE (); }
858 static Exception CreateNIE ()
860 return new NotImplementedException ("Derived classes must implement it");
863 public virtual IList<CustomAttributeData> GetCustomAttributesData ()
865 return CustomAttributeData.GetCustomAttributes (this);
869 public bool IsFullyTrusted {
873 public virtual Type GetType (string name, bool throwOnError, bool ignoreCase)
878 public virtual Module GetModule (String name)
883 public virtual AssemblyName[] GetReferencedAssemblies ()
888 public virtual Module[] GetModules (bool getResourceModules)
893 [MonoTODO ("Always returns the same as GetModules")]
894 public virtual Module[] GetLoadedModules (bool getResourceModules)
899 public virtual Assembly GetSatelliteAssembly (CultureInfo culture)
904 public virtual Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
909 public virtual Module ManifestModule {
910 get { throw CreateNIE (); }
913 public virtual bool GlobalAssemblyCache {
914 get { throw CreateNIE (); }
917 public virtual bool IsDynamic {
918 get { return false; }
921 public static bool operator == (Assembly left, Assembly right)
923 if ((object)left == (object)right)
925 if ((object)left == null ^ (object)right == null)
927 return left.Equals (right);
930 public static bool operator != (Assembly left, Assembly right)
932 if ((object)left == (object)right)
934 if ((object)left == null ^ (object)right == null)
936 return !left.Equals (right);
939 public virtual IEnumerable<TypeInfo> DefinedTypes {
941 foreach (var type in GetTypes ()) {
942 yield return type.GetTypeInfo ();
947 public virtual IEnumerable<Type> ExportedTypes {
948 get { return GetExportedTypes (); }
951 public virtual IEnumerable<Module> Modules {
952 get { return GetModules (); }
955 public virtual IEnumerable<CustomAttributeData> CustomAttributes {
956 get { return GetCustomAttributesData (); }