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;
42 using System.Threading;
44 using System.Diagnostics.Contracts;
48 namespace System.Reflection {
51 [ComDefaultInterfaceAttribute (typeof (_Assembly))]
53 [ClassInterface(ClassInterfaceType.None)]
54 [StructLayout (LayoutKind.Sequential)]
56 public partial class Assembly : ICustomAttributeProvider, ISerializable
58 public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable
61 internal class ResolveEventHolder {
62 #pragma warning disable 67
63 public event ModuleResolveEventHandler ModuleResolve;
64 #pragma warning restore
67 internal class UnmanagedMemoryStreamForModule : UnmanagedMemoryStream
69 #pragma warning disable 414
71 #pragma warning restore
73 public unsafe UnmanagedMemoryStreamForModule (byte* pointer, long length, Module module)
74 : base (pointer, length)
79 protected override void Dispose (bool disposing)
83 * The returned pointer points inside metadata, so
84 * we have to increase the refcount of the module, and decrease
85 * it when the stream is finalized.
90 base.Dispose (disposing);
94 // Note: changes to fields must be reflected in _MonoReflectionAssembly struct (object-internals.h)
95 #pragma warning disable 649
96 internal IntPtr _mono_assembly;
97 #pragma warning restore 649
99 private ResolveEventHolder resolve_event_holder;
101 private Evidence _evidence;
102 internal PermissionSet _minimum; // for SecurityAction.RequestMinimum
103 internal PermissionSet _optional; // for SecurityAction.RequestOptional
104 internal PermissionSet _refuse; // for SecurityAction.RequestRefuse
105 private PermissionSet _granted; // for the resolved assembly granted permissions
106 private PermissionSet _denied; // for the resolved assembly denied permissions
108 object _evidence, _minimum, _optional, _refuse, _granted, _denied;
110 private bool fromByteArray;
111 private string assemblyName;
116 resolve_event_holder = new ResolveEventHolder ();
120 // We can't store the event directly in this class, since the
121 // compiler would silently insert the fields before _mono_assembly
123 public virtual event ModuleResolveEventHandler ModuleResolve {
124 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
126 resolve_event_holder.ModuleResolve += value;
128 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
130 resolve_event_holder.ModuleResolve -= value;
134 [MethodImplAttribute (MethodImplOptions.InternalCall)]
135 private extern string get_code_base (bool escaped);
137 [MethodImplAttribute (MethodImplOptions.InternalCall)]
138 private extern string get_fullname ();
140 [MethodImplAttribute (MethodImplOptions.InternalCall)]
141 private extern string get_location ();
143 [MethodImplAttribute (MethodImplOptions.InternalCall)]
144 private extern string InternalImageRuntimeVersion ();
146 [MethodImplAttribute (MethodImplOptions.InternalCall)]
147 static internal extern string GetAotId ();
149 // SECURITY: this should be the only caller to icall get_code_base
150 private string GetCodeBase (bool escaped)
152 string cb = get_code_base (escaped);
154 if (SecurityManager.SecurityEnabled) {
155 // we cannot divulge local file informations
156 if (String.Compare ("FILE://", 0, cb, 0, 7, true, CultureInfo.InvariantCulture) == 0) {
157 string file = cb.Substring (7);
158 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, file).Demand ();
165 public virtual string CodeBase {
166 get { return GetCodeBase (false); }
169 public virtual string EscapedCodeBase {
170 get { return GetCodeBase (true); }
173 public virtual string FullName {
176 // FIXME: This is wrong, but it gets us going
177 // in the compiler for now
183 public virtual extern MethodInfo EntryPoint {
184 [MethodImplAttribute (MethodImplOptions.InternalCall)]
188 public virtual Evidence Evidence {
189 [SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
190 get { return UnprotectedGetEvidence (); }
193 // note: the security runtime requires evidences but may be unable to do so...
194 internal Evidence UnprotectedGetEvidence ()
199 // if the host (runtime) hasn't provided it's own evidence...
200 if (_evidence == null) {
201 // ... we will provide our own
203 _evidence = Evidence.GetDefaultHostEvidence (this);
210 [MethodImplAttribute (MethodImplOptions.InternalCall)]
211 internal extern bool get_global_assembly_cache ();
213 internal bool FromByteArray {
214 set { fromByteArray = value; }
217 public virtual String Location {
222 string loc = get_location ();
224 if ((loc != String.Empty) && SecurityManager.SecurityEnabled) {
225 // we cannot divulge local file informations
226 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, loc).Demand ();
234 public virtual string ImageRuntimeVersion {
236 return InternalImageRuntimeVersion ();
240 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
242 throw new NotImplementedException ();
245 public virtual bool IsDefined (Type attributeType, bool inherit)
247 return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
250 public virtual object [] GetCustomAttributes (bool inherit)
252 return MonoCustomAttrs.GetCustomAttributes (this, inherit);
255 public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
257 return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
260 [MethodImplAttribute (MethodImplOptions.InternalCall)]
261 private extern object GetFilesInternal (String name, bool getResourceModules);
263 public virtual FileStream[] GetFiles ()
265 return GetFiles (false);
268 public virtual FileStream [] GetFiles (bool getResourceModules)
270 string[] names = (string[]) GetFilesInternal (null, getResourceModules);
272 return EmptyArray<FileStream>.Value;
274 string location = Location;
277 if (location != String.Empty) {
278 res = new FileStream [names.Length + 1];
279 res [0] = new FileStream (location, FileMode.Open, FileAccess.Read);
280 for (int i = 0; i < names.Length; ++i)
281 res [i + 1] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
283 res = new FileStream [names.Length];
284 for (int i = 0; i < names.Length; ++i)
285 res [i] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
290 public virtual FileStream GetFile (String name)
293 throw new ArgumentNullException (null, "Name cannot be null.");
294 if (name.Length == 0)
295 throw new ArgumentException ("Empty name is not valid");
297 string filename = (string)GetFilesInternal (name, true);
298 if (filename != null)
299 return new FileStream (filename, FileMode.Open, FileAccess.Read);
304 [MethodImplAttribute (MethodImplOptions.InternalCall)]
305 internal extern IntPtr GetManifestResourceInternal (String name, out int size, out Module module);
307 public virtual Stream GetManifestResourceStream (String name)
310 throw new ArgumentNullException ("name");
311 if (name.Length == 0)
312 throw new ArgumentException ("String cannot have zero length.",
315 ManifestResourceInfo info = GetManifestResourceInfo (name);
317 Assembly a = AppDomain.CurrentDomain.DoResourceResolve (name, this);
318 if (a != null && a != this)
319 return a.GetManifestResourceStream (name);
324 if (info.ReferencedAssembly != null)
325 return info.ReferencedAssembly.GetManifestResourceStream (name);
326 if ((info.FileName != null) && (info.ResourceLocation == 0)) {
328 throw new FileNotFoundException (info.FileName);
330 string location = Path.GetDirectoryName (Location);
331 string filename = Path.Combine (location, info.FileName);
332 return new FileStream (filename, FileMode.Open, FileAccess.Read);
337 IntPtr data = GetManifestResourceInternal (name, out size, out module);
338 if (data == (IntPtr) 0)
341 UnmanagedMemoryStream stream;
343 stream = new UnmanagedMemoryStreamForModule ((byte*) data, size, module);
349 public virtual Stream GetManifestResourceStream (Type type, String name)
351 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
352 return GetManifestResourceStream(type, name, false, ref stackMark);
355 internal Stream GetManifestResourceStream (Type type, String name, bool skipSecurityCheck, ref StackCrawlMark stackMark)
357 StringBuilder sb = new StringBuilder ();
360 throw new ArgumentNullException ("type");
362 String nameSpace = type.Namespace;
363 if (nameSpace != null) {
364 sb.Append (nameSpace);
366 sb.Append (Type.Delimiter);
373 return GetManifestResourceStream (sb.ToString());
376 internal unsafe Stream GetManifestResourceStream(String name, ref StackCrawlMark stackMark, bool skipSecurityCheck)
378 return GetManifestResourceStream (null, name, skipSecurityCheck, ref stackMark);
381 internal String GetSimpleName()
383 AssemblyName aname = GetName (true);
387 internal byte[] GetPublicKey()
389 AssemblyName aname = GetName (true);
390 return aname.GetPublicKey ();
393 internal Version GetVersion()
395 AssemblyName aname = GetName (true);
396 return aname.Version;
399 private AssemblyNameFlags GetFlags()
401 AssemblyName aname = GetName (true);
405 [MethodImplAttribute (MethodImplOptions.InternalCall)]
406 internal virtual extern Type[] GetTypes (bool exportedOnly);
408 public virtual Type[] GetTypes ()
410 return GetTypes (false);
413 public virtual Type[] GetExportedTypes ()
415 return GetTypes (true);
418 public virtual Type GetType (String name, Boolean throwOnError)
420 return GetType (name, throwOnError, false);
423 public virtual Type GetType (String name) {
424 return GetType (name, false, false);
427 [MethodImplAttribute (MethodImplOptions.InternalCall)]
428 internal extern Type InternalGetType (Module module, String name, Boolean throwOnError, Boolean ignoreCase);
430 [MethodImplAttribute (MethodImplOptions.InternalCall)]
431 internal extern static void InternalGetAssemblyName (string assemblyFile, AssemblyName aname);
433 public virtual AssemblyName GetName (Boolean copiedName)
435 throw new NotImplementedException ();
438 public virtual AssemblyName GetName ()
440 return GetName (false);
443 public override string ToString ()
445 // note: ToString work without requiring CodeBase (so no checks are needed)
447 if (assemblyName != null)
450 assemblyName = get_fullname ();
454 public static String CreateQualifiedName (String assemblyName, String typeName)
456 return typeName + ", " + assemblyName;
459 public static Assembly GetAssembly (Type type)
462 return type.Assembly;
463 throw new ArgumentNullException ("type");
467 [MethodImplAttribute (MethodImplOptions.InternalCall)]
468 public static extern Assembly GetEntryAssembly();
470 internal Assembly GetSatelliteAssembly (CultureInfo culture, Version version, bool throwOnError)
473 throw new ArgumentNullException("culture");
474 Contract.EndContractBlock();
476 StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
477 String name = GetSimpleName() + ".resources";
478 return InternalGetSatelliteAssembly(name, culture, version, true, ref stackMark);
481 internal RuntimeAssembly InternalGetSatelliteAssembly (String name, CultureInfo culture, Version version, bool throwOnFileNotFound, ref StackCrawlMark stackMark)
483 AssemblyName an = new AssemblyName ();
485 an.SetPublicKey (GetPublicKey ());
486 an.Flags = GetFlags () | AssemblyNameFlags.PublicKey;
489 an.Version = GetVersion ();
491 an.Version = version;
493 an.CultureInfo = culture;
499 assembly = AppDomain.CurrentDomain.LoadSatellite (an, false);
500 if (assembly != null)
501 return (RuntimeAssembly)assembly;
502 } catch (FileNotFoundException) {
507 if (String.IsNullOrEmpty (Location))
510 // Try the assembly directory
511 string location = Path.GetDirectoryName (Location);
512 string fullName = Path.Combine (location, Path.Combine (culture.Name, an.Name + ".dll"));
515 return (RuntimeAssembly)LoadFrom (fullName);
517 if (!throwOnFileNotFound && !File.Exists (fullName))
524 Type _Assembly.GetType ()
526 // Required or object::GetType becomes virtual final
527 return base.GetType ();
531 [MethodImplAttribute (MethodImplOptions.InternalCall)]
532 private extern static Assembly LoadFrom (String assemblyFile, bool refonly);
534 public static Assembly LoadFrom (String assemblyFile)
536 return LoadFrom (assemblyFile, false);
540 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
542 Assembly a = LoadFrom (assemblyFile, false);
544 if ((a != null) && (securityEvidence != null)) {
545 // merge evidence (i.e. replace defaults with provided evidences)
546 a.Evidence.Merge (securityEvidence);
553 [MonoTODO("This overload is not currently implemented")]
554 // FIXME: What are we missing?
555 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
557 throw new NotImplementedException ();
561 public static Assembly LoadFrom (String assemblyFile, byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm)
563 throw new NotImplementedException ();
566 public static Assembly UnsafeLoadFrom (String assemblyFile)
568 return LoadFrom (assemblyFile);
572 public static Assembly LoadFile (String path, Evidence securityEvidence)
575 throw new ArgumentNullException ("path");
576 if (path == String.Empty)
577 throw new ArgumentException ("Path can't be empty", "path");
578 // FIXME: Make this do the right thing
579 return LoadFrom (path, securityEvidence);
582 public static Assembly LoadFile (String path)
584 return LoadFile (path, null);
587 public static Assembly Load (String assemblyString)
589 return AppDomain.CurrentDomain.Load (assemblyString);
593 public static Assembly Load (String assemblyString, Evidence assemblySecurity)
595 return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
598 public static Assembly Load (AssemblyName assemblyRef)
600 return AppDomain.CurrentDomain.Load (assemblyRef);
604 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
606 return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
609 public static Assembly Load (Byte[] rawAssembly)
611 return AppDomain.CurrentDomain.Load (rawAssembly);
614 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
616 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
620 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
621 Evidence securityEvidence)
623 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
626 [MonoLimitation ("Argument securityContextSource is ignored")]
627 public static Assembly Load (byte [] rawAssembly, byte [] rawSymbolStore, SecurityContextSource securityContextSource)
629 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
632 public static Assembly ReflectionOnlyLoad (byte[] rawAssembly)
634 return AppDomain.CurrentDomain.Load (rawAssembly, null, null, true);
637 public static Assembly ReflectionOnlyLoad (string assemblyString)
639 return AppDomain.CurrentDomain.Load (assemblyString, null, true);
642 public static Assembly ReflectionOnlyLoadFrom (string assemblyFile)
644 if (assemblyFile == null)
645 throw new ArgumentNullException ("assemblyFile");
647 return LoadFrom (assemblyFile, true);
651 public static Assembly LoadWithPartialName (string partialName)
653 return LoadWithPartialName (partialName, null);
656 [MonoTODO ("Not implemented")]
657 public Module LoadModule (string moduleName, byte [] rawModule)
659 throw new NotImplementedException ();
662 [MonoTODO ("Not implemented")]
665 Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
667 throw new NotImplementedException ();
670 [MethodImplAttribute (MethodImplOptions.InternalCall)]
671 private static extern Assembly load_with_partial_name (string name, Evidence e);
674 public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
676 return LoadWithPartialName (partialName, securityEvidence, true);
680 * LAMESPEC: It is possible for this method to throw exceptions IF the name supplied
681 * is a valid gac name and contains filesystem entry charachters at the end of the name
682 * ie System/// will throw an exception. However ////System will not as that is canocolized
686 // FIXME: LoadWithPartialName must look cache (no CAS) or read from disk (CAS)
687 internal static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
690 throw new NotImplementedException ();
692 if (partialName == null)
693 throw new NullReferenceException ();
695 return load_with_partial_name (partialName, securityEvidence);
698 public Object CreateInstance (String typeName)
700 return CreateInstance (typeName, false);
703 public Object CreateInstance (String typeName, Boolean ignoreCase)
705 Type t = GetType (typeName, false, ignoreCase);
710 return Activator.CreateInstance (t);
711 } catch (InvalidOperationException) {
712 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
718 Object CreateInstance (String typeName, Boolean ignoreCase,
719 BindingFlags bindingAttr, Binder binder,
720 Object[] args, CultureInfo culture,
721 Object[] activationAttributes)
723 Type t = GetType (typeName, false, ignoreCase);
728 return Activator.CreateInstance (t, bindingAttr, binder, args, culture, activationAttributes);
729 } catch (InvalidOperationException) {
730 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
734 public Module[] GetLoadedModules ()
736 return GetLoadedModules (false);
739 public Module[] GetModules ()
741 return GetModules (false);
744 [MethodImplAttribute (MethodImplOptions.InternalCall)]
745 internal virtual extern Module[] GetModulesInternal ();
747 [MethodImplAttribute (MethodImplOptions.InternalCall)]
748 public extern virtual String[] GetManifestResourceNames ();
750 [MethodImplAttribute (MethodImplOptions.InternalCall)]
751 public extern static Assembly GetExecutingAssembly ();
753 [MethodImplAttribute (MethodImplOptions.InternalCall)]
754 public extern static Assembly GetCallingAssembly ();
756 [MethodImplAttribute (MethodImplOptions.InternalCall)]
757 internal static extern AssemblyName[] GetReferencedAssemblies (Assembly module);
759 [MethodImplAttribute (MethodImplOptions.InternalCall)]
760 private extern bool GetManifestResourceInfoInternal (String name, ManifestResourceInfo info);
762 public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
764 if (resourceName == null)
765 throw new ArgumentNullException ("resourceName");
766 if (resourceName.Length == 0)
767 throw new ArgumentException ("String cannot have zero length.");
768 ManifestResourceInfo result = new ManifestResourceInfo (null, null, 0);
769 bool found = GetManifestResourceInfoInternal (resourceName, result);
776 [MonoTODO ("Currently it always returns zero")]
785 internal virtual Module GetManifestModule () {
786 return GetManifestModuleInternal ();
789 [MethodImplAttribute (MethodImplOptions.InternalCall)]
790 internal extern Module GetManifestModuleInternal ();
793 public virtual extern bool ReflectionOnly {
794 [MethodImplAttribute (MethodImplOptions.InternalCall)]
798 public override int GetHashCode ()
800 return base.GetHashCode ();
803 public override bool Equals (object o)
805 if (((object) this) == o)
811 Assembly other = (Assembly) o;
812 return other._mono_assembly == _mono_assembly;
816 // Code Access Security
818 internal void Resolve ()
821 // FIXME: As we (currently) delay the resolution until the first CAS
822 // Demand it's too late to evaluate the Minimum permission set as a
823 // condition to load the assembly into the AppDomain
824 LoadAssemblyPermissions ();
825 Evidence e = new Evidence (UnprotectedGetEvidence ()); // we need a copy to add PRE
826 e.AddHost (new PermissionRequestEvidence (_minimum, _optional, _refuse));
827 _granted = SecurityManager.ResolvePolicy (e,
828 _minimum, _optional, _refuse, out _denied);
832 internal PermissionSet GrantedPermissionSet {
834 if (_granted == null) {
835 if (SecurityManager.ResolvingPolicyLevel != null) {
836 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
837 return DefaultPolicies.FullTrust;
839 return null; // we can't resolve during resolution
847 internal PermissionSet DeniedPermissionSet {
849 // yes we look for granted, as denied may be null
850 if (_granted == null) {
851 if (SecurityManager.ResolvingPolicyLevel != null) {
852 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
855 return DefaultPolicies.FullTrust; // deny unrestricted
863 [MethodImplAttribute (MethodImplOptions.InternalCall)]
864 extern internal static bool LoadPermissions (Assembly a,
865 ref IntPtr minimum, ref int minLength,
866 ref IntPtr optional, ref int optLength,
867 ref IntPtr refused, ref int refLength);
869 // Support for SecurityAction.RequestMinimum, RequestOptional and RequestRefuse
870 private void LoadAssemblyPermissions ()
872 IntPtr minimum = IntPtr.Zero, optional = IntPtr.Zero, refused = IntPtr.Zero;
873 int minLength = 0, optLength = 0, refLength = 0;
874 if (LoadPermissions (this, ref minimum, ref minLength, ref optional,
875 ref optLength, ref refused, ref refLength)) {
877 // Note: no need to cache these permission sets as they will only be created once
878 // at assembly resolution time.
880 byte[] data = new byte [minLength];
881 Marshal.Copy (minimum, data, 0, minLength);
882 _minimum = SecurityManager.Decode (data);
885 byte[] data = new byte [optLength];
886 Marshal.Copy (optional, data, 0, optLength);
887 _optional = SecurityManager.Decode (data);
890 byte[] data = new byte [refLength];
891 Marshal.Copy (refused, data, 0, refLength);
892 _refuse = SecurityManager.Decode (data);
897 public virtual PermissionSet PermissionSet {
898 get { return this.GrantedPermissionSet; }
902 public virtual SecurityRuleSet SecurityRuleSet {
903 get { throw CreateNIE (); }
906 static Exception CreateNIE ()
908 return new NotImplementedException ("Derived classes must implement it");
911 public virtual IList<CustomAttributeData> GetCustomAttributesData ()
913 return CustomAttributeData.GetCustomAttributes (this);
917 public bool IsFullyTrusted {
921 public virtual Type GetType (string name, bool throwOnError, bool ignoreCase)
926 public virtual Module GetModule (String name)
931 public virtual AssemblyName[] GetReferencedAssemblies ()
936 public virtual Module[] GetModules (bool getResourceModules)
941 [MonoTODO ("Always returns the same as GetModules")]
942 public virtual Module[] GetLoadedModules (bool getResourceModules)
947 public virtual Assembly GetSatelliteAssembly (CultureInfo culture)
952 public virtual Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
957 public virtual Module ManifestModule {
958 get { throw CreateNIE (); }
961 public virtual bool GlobalAssemblyCache {
962 get { throw CreateNIE (); }
965 public virtual bool IsDynamic {
966 get { return false; }
969 public static bool operator == (Assembly left, Assembly right)
971 if ((object)left == (object)right)
973 if ((object)left == null ^ (object)right == null)
975 return left.Equals (right);
978 public static bool operator != (Assembly left, Assembly right)
980 if ((object)left == (object)right)
982 if ((object)left == null ^ (object)right == null)
984 return !left.Equals (right);
987 public virtual IEnumerable<TypeInfo> DefinedTypes {
989 foreach (var type in GetTypes ()) {
990 yield return type.GetTypeInfo ();
995 public virtual IEnumerable<Type> ExportedTypes {
996 get { return GetExportedTypes (); }
999 public virtual IEnumerable<Module> Modules {
1000 get { return GetModules (); }
1003 public virtual IEnumerable<CustomAttributeData> CustomAttributes {
1004 get { return GetCustomAttributesData (); }