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, _Assembly {
55 public abstract class Assembly : ICustomAttributeProvider, _Assembly {
57 public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
59 public partial class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
61 internal class ResolveEventHolder {
62 public event ModuleResolveEventHandler ModuleResolve;
65 // Note: changes to fields must be reflected in _MonoReflectionAssembly struct (object-internals.h)
66 #pragma warning disable 649
67 private IntPtr _mono_assembly;
68 #pragma warning restore 649
70 private ResolveEventHolder resolve_event_holder;
71 private Evidence _evidence;
72 internal PermissionSet _minimum; // for SecurityAction.RequestMinimum
73 internal PermissionSet _optional; // for SecurityAction.RequestOptional
74 internal PermissionSet _refuse; // for SecurityAction.RequestRefuse
75 private PermissionSet _granted; // for the resolved assembly granted permissions
76 private PermissionSet _denied; // for the resolved assembly denied permissions
77 private bool fromByteArray;
78 private string assemblyName;
80 #if NET_4_0 || MOONLIGHT || MOBILE
87 resolve_event_holder = new ResolveEventHolder ();
91 // We can't store the event directly in this class, since the
92 // compiler would silently insert the fields before _mono_assembly
94 public event ModuleResolveEventHandler ModuleResolve {
95 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
97 resolve_event_holder.ModuleResolve += value;
99 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
101 resolve_event_holder.ModuleResolve -= value;
105 [MethodImplAttribute (MethodImplOptions.InternalCall)]
106 private extern string get_code_base (bool escaped);
108 [MethodImplAttribute (MethodImplOptions.InternalCall)]
109 private extern string get_fullname ();
111 [MethodImplAttribute (MethodImplOptions.InternalCall)]
112 private extern string get_location ();
114 [MethodImplAttribute (MethodImplOptions.InternalCall)]
115 private extern string InternalImageRuntimeVersion ();
117 // SECURITY: this should be the only caller to icall get_code_base
118 private string GetCodeBase (bool escaped)
120 string cb = get_code_base (escaped);
122 if (SecurityManager.SecurityEnabled) {
123 // we cannot divulge local file informations
124 if (String.Compare ("FILE://", 0, cb, 0, 7, true, CultureInfo.InvariantCulture) == 0) {
125 string file = cb.Substring (7);
126 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, file).Demand ();
133 public virtual string CodeBase {
134 get { return GetCodeBase (false); }
137 public virtual string EscapedCodeBase {
138 get { return GetCodeBase (true); }
141 public virtual string FullName {
144 // FIXME: This is wrong, but it gets us going
145 // in the compiler for now
151 public virtual extern MethodInfo EntryPoint {
152 [MethodImplAttribute (MethodImplOptions.InternalCall)]
156 public virtual Evidence Evidence {
157 [SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
158 get { return UnprotectedGetEvidence (); }
161 // note: the security runtime requires evidences but may be unable to do so...
162 internal Evidence UnprotectedGetEvidence ()
167 // if the host (runtime) hasn't provided it's own evidence...
168 if (_evidence == null) {
169 // ... we will provide our own
171 _evidence = Evidence.GetDefaultHostEvidence (this);
178 [MethodImplAttribute (MethodImplOptions.InternalCall)]
179 internal extern bool get_global_assembly_cache ();
182 internal bool FromByteArray {
183 set { fromByteArray = value; }
186 public virtual String Location {
191 string loc = get_location ();
193 if ((loc != String.Empty) && SecurityManager.SecurityEnabled) {
194 // we cannot divulge local file informations
195 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, loc).Demand ();
203 public virtual string ImageRuntimeVersion {
205 return InternalImageRuntimeVersion ();
209 [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
210 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
213 throw new ArgumentNullException ("info");
215 UnitySerializationHolder.GetAssemblyData (this, info, context);
218 public virtual bool IsDefined (Type attributeType, bool inherit)
220 return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
223 public virtual object [] GetCustomAttributes (bool inherit)
225 return MonoCustomAttrs.GetCustomAttributes (this, inherit);
228 public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
230 return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
233 [MethodImplAttribute (MethodImplOptions.InternalCall)]
234 private extern object GetFilesInternal (String name, bool getResourceModules);
236 public virtual FileStream[] GetFiles ()
238 return GetFiles (false);
241 public virtual FileStream [] GetFiles (bool getResourceModules)
243 string[] names = (string[]) GetFilesInternal (null, getResourceModules);
245 return new FileStream [0];
247 string location = Location;
250 if (location != String.Empty) {
251 res = new FileStream [names.Length + 1];
252 res [0] = new FileStream (location, FileMode.Open, FileAccess.Read);
253 for (int i = 0; i < names.Length; ++i)
254 res [i + 1] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
256 res = new FileStream [names.Length];
257 for (int i = 0; i < names.Length; ++i)
258 res [i] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
263 public virtual FileStream GetFile (String name)
266 throw new ArgumentNullException (null, "Name cannot be null.");
267 if (name.Length == 0)
268 throw new ArgumentException ("Empty name is not valid");
270 string filename = (string)GetFilesInternal (name, true);
271 if (filename != null)
272 return new FileStream (filename, FileMode.Open, FileAccess.Read);
277 [MethodImplAttribute (MethodImplOptions.InternalCall)]
278 internal extern IntPtr GetManifestResourceInternal (String name, out int size, out Module module);
280 public virtual Stream GetManifestResourceStream (String name)
283 throw new ArgumentNullException ("name");
284 if (name.Length == 0)
285 throw new ArgumentException ("String cannot have zero length.",
288 ManifestResourceInfo info = GetManifestResourceInfo (name);
290 Assembly a = AppDomain.CurrentDomain.DoResourceResolve (name, this);
291 if (a != null && a != this)
292 return a.GetManifestResourceStream (name);
297 if (info.ReferencedAssembly != null)
298 return info.ReferencedAssembly.GetManifestResourceStream (name);
299 if ((info.FileName != null) && (info.ResourceLocation == 0)) {
301 throw new FileNotFoundException (info.FileName);
303 string location = Path.GetDirectoryName (Location);
304 string filename = Path.Combine (location, info.FileName);
306 // we don't control the content of 'info.FileName' so we want to make sure we keep to ourselves
307 filename = Path.GetFullPath (filename);
308 if (!filename.StartsWith (location))
309 throw new SecurityException ("non-rooted access to manifest resource");
311 return new FileStream (filename, FileMode.Open, FileAccess.Read);
316 IntPtr data = GetManifestResourceInternal (name, out size, out module);
317 if (data == (IntPtr) 0)
320 UnmanagedMemoryStream stream;
322 stream = new UnmanagedMemoryStream ((byte*) data, size);
325 * The returned pointer points inside metadata, so
326 * we have to increase the refcount of the module, and decrease
327 * it when the stream is finalized.
329 stream.Closed += new EventHandler (new ResourceCloseHandler (module).OnClose);
334 public virtual Stream GetManifestResourceStream (Type type, String name)
341 throw new ArgumentNullException ("type");
345 if (ns == null || ns.Length == 0)
346 return GetManifestResourceStream (name);
348 return GetManifestResourceStream (ns + "." + name);
351 [MethodImplAttribute (MethodImplOptions.InternalCall)]
352 internal virtual extern Type[] GetTypes (bool exportedOnly);
354 public virtual Type[] GetTypes ()
356 return GetTypes (false);
359 public virtual Type[] GetExportedTypes ()
361 return GetTypes (true);
364 public virtual Type GetType (String name, Boolean throwOnError)
366 return GetType (name, throwOnError, false);
369 public virtual Type GetType (String name) {
370 return GetType (name, false, false);
373 [MethodImplAttribute (MethodImplOptions.InternalCall)]
374 internal extern Type InternalGetType (Module module, String name, Boolean throwOnError, Boolean ignoreCase);
376 [MethodImplAttribute (MethodImplOptions.InternalCall)]
377 internal extern static void InternalGetAssemblyName (string assemblyFile, AssemblyName aname);
379 [MethodImplAttribute (MethodImplOptions.InternalCall)]
380 static extern void FillName (Assembly ass, AssemblyName aname);
382 [MonoTODO ("copiedName == true is not supported")]
383 public virtual AssemblyName GetName (Boolean copiedName)
385 // CodeBase, which is restricted, will be copied into the AssemblyName object so...
386 if (SecurityManager.SecurityEnabled) {
387 GetCodeBase (true); // this will ensure the Demand is made
389 return UnprotectedGetName ();
392 public virtual AssemblyName GetName ()
394 return GetName (false);
397 // the security runtime requires access to the assemblyname (e.g. to get the strongname)
398 internal virtual AssemblyName UnprotectedGetName ()
400 AssemblyName aname = new AssemblyName ();
401 FillName (this, aname);
405 public override string ToString ()
407 // note: ToString work without requiring CodeBase (so no checks are needed)
409 if (assemblyName != null)
412 assemblyName = get_fullname ();
416 public static String CreateQualifiedName (String assemblyName, String typeName)
418 return typeName + ", " + assemblyName;
421 public static Assembly GetAssembly (Type type)
424 return type.Assembly;
425 throw new ArgumentNullException ("type");
429 [MethodImplAttribute (MethodImplOptions.InternalCall)]
430 public static extern Assembly GetEntryAssembly();
432 internal Assembly GetSatelliteAssemblyNoThrow (CultureInfo culture, Version version)
434 return GetSatelliteAssembly (culture, version, false);
437 internal Assembly GetSatelliteAssembly (CultureInfo culture, Version version, bool throwOnError)
440 throw new ArgumentException ("culture");
442 AssemblyName aname = GetName (true);
444 aname.Version = version;
446 aname.CultureInfo = culture;
447 aname.Name = aname.Name + ".resources";
451 assembly = AppDomain.CurrentDomain.LoadSatellite (aname, false);
452 if (assembly != null)
454 } catch (FileNotFoundException) {
459 // Try the assembly directory
460 string location = Path.GetDirectoryName (Location);
461 string fullName = Path.Combine (location, Path.Combine (culture.Name, aname.Name + ".dll"));
463 // it's unlikely that culture.Name or aname.Name could contain stuff like ".." but...
464 fullName = Path.GetFullPath (fullName);
465 if (!fullName.StartsWith (location)) {
467 throw new SecurityException ("non-rooted access to satellite assembly");
471 if (!throwOnError && !File.Exists (fullName))
474 return LoadFrom (fullName);
477 [MethodImplAttribute (MethodImplOptions.InternalCall)]
478 private extern static Assembly LoadFrom (String assemblyFile, bool refonly);
480 public static Assembly LoadFrom (String assemblyFile)
482 return LoadFrom (assemblyFile, false);
488 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
490 Assembly a = LoadFrom (assemblyFile, false);
492 if ((a != null) && (securityEvidence != null)) {
493 // merge evidence (i.e. replace defaults with provided evidences)
494 a.Evidence.Merge (securityEvidence);
503 [MonoTODO("This overload is not currently implemented")]
504 // FIXME: What are we missing?
505 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
507 throw new NotImplementedException ();
512 public static Assembly LoadFrom (String assemblyFile, byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm)
514 throw new NotImplementedException ();
519 public static Assembly UnsafeLoadFrom (String assemblyFile)
521 return LoadFrom (assemblyFile);
528 public static Assembly LoadFile (String path, Evidence securityEvidence)
531 throw new ArgumentNullException ("path");
532 if (path == String.Empty)
533 throw new ArgumentException ("Path can't be empty", "path");
534 // FIXME: Make this do the right thing
535 return LoadFrom (path, securityEvidence);
538 public static Assembly LoadFile (String path)
540 return LoadFile (path, null);
543 public static Assembly Load (String assemblyString)
545 return AppDomain.CurrentDomain.Load (assemblyString);
551 public static Assembly Load (String assemblyString, Evidence assemblySecurity)
553 return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
556 public static Assembly Load (AssemblyName assemblyRef)
558 return AppDomain.CurrentDomain.Load (assemblyRef);
564 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
566 return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
569 public static Assembly Load (Byte[] rawAssembly)
571 return AppDomain.CurrentDomain.Load (rawAssembly);
574 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
576 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
582 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
583 Evidence securityEvidence)
585 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
589 [MonoLimitation ("Argument securityContextSource is ignored")]
590 public static Assembly Load (byte [] rawAssembly, byte [] rawSymbolStore, SecurityContextSource securityContextSource)
592 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
596 public static Assembly ReflectionOnlyLoad (byte[] rawAssembly)
598 return AppDomain.CurrentDomain.Load (rawAssembly, null, null, true);
601 public static Assembly ReflectionOnlyLoad (string assemblyString)
603 return AppDomain.CurrentDomain.Load (assemblyString, null, true);
606 public static Assembly ReflectionOnlyLoadFrom (string assemblyFile)
608 if (assemblyFile == null)
609 throw new ArgumentNullException ("assemblyFile");
611 return LoadFrom (assemblyFile, true);
615 public static Assembly LoadWithPartialName (string partialName)
617 return LoadWithPartialName (partialName, null);
620 [MonoTODO ("Not implemented")]
621 public Module LoadModule (string moduleName, byte [] rawModule)
623 throw new NotImplementedException ();
626 [MonoTODO ("Not implemented")]
628 #if NET_4_0 || MOONLIGHT || MOBILE
631 Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
633 throw new NotImplementedException ();
636 [MethodImplAttribute (MethodImplOptions.InternalCall)]
637 private static extern Assembly load_with_partial_name (string name, Evidence e);
640 public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
642 return LoadWithPartialName (partialName, securityEvidence, true);
646 * LAMESPEC: It is possible for this method to throw exceptions IF the name supplied
647 * is a valid gac name and contains filesystem entry charachters at the end of the name
648 * ie System/// will throw an exception. However ////System will not as that is canocolized
652 // FIXME: LoadWithPartialName must look cache (no CAS) or read from disk (CAS)
653 internal static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
656 throw new NotImplementedException ();
658 if (partialName == null)
659 throw new NullReferenceException ();
661 return load_with_partial_name (partialName, securityEvidence);
664 public Object CreateInstance (String typeName)
666 return CreateInstance (typeName, false);
669 public Object CreateInstance (String typeName, Boolean ignoreCase)
671 Type t = GetType (typeName, false, ignoreCase);
676 return Activator.CreateInstance (t);
677 } catch (InvalidOperationException) {
678 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
683 #if NET_4_0 || MOONLIGHT || MOBILE
686 Object CreateInstance (String typeName, Boolean ignoreCase,
687 BindingFlags bindingAttr, Binder binder,
688 Object[] args, CultureInfo culture,
689 Object[] activationAttributes)
691 Type t = GetType (typeName, false, ignoreCase);
696 return Activator.CreateInstance (t, bindingAttr, binder, args, culture, activationAttributes);
697 } catch (InvalidOperationException) {
698 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
702 public Module[] GetLoadedModules ()
704 return GetLoadedModules (false);
707 public Module[] GetModules ()
709 return GetModules (false);
712 [MethodImplAttribute (MethodImplOptions.InternalCall)]
713 internal virtual extern Module[] GetModulesInternal ();
716 [MethodImplAttribute (MethodImplOptions.InternalCall)]
717 internal extern string[] GetNamespaces ();
719 [MethodImplAttribute (MethodImplOptions.InternalCall)]
720 public extern virtual String[] GetManifestResourceNames ();
722 [MethodImplAttribute (MethodImplOptions.InternalCall)]
723 public extern static Assembly GetExecutingAssembly ();
725 [MethodImplAttribute (MethodImplOptions.InternalCall)]
726 public extern static Assembly GetCallingAssembly ();
728 [MethodImplAttribute (MethodImplOptions.InternalCall)]
729 internal static extern AssemblyName[] GetReferencedAssemblies (Assembly module);
731 [MethodImplAttribute (MethodImplOptions.InternalCall)]
732 private extern bool GetManifestResourceInfoInternal (String name, ManifestResourceInfo info);
734 public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
736 if (resourceName == null)
737 throw new ArgumentNullException ("resourceName");
738 if (resourceName.Length == 0)
739 throw new ArgumentException ("String cannot have zero length.");
740 ManifestResourceInfo result = new ManifestResourceInfo ();
741 bool found = GetManifestResourceInfoInternal (resourceName, result);
748 private class ResourceCloseHandler {
749 #pragma warning disable 169, 414
751 #pragma warning restore 169, 414
753 public ResourceCloseHandler (Module module) {
754 this.module = module;
757 public void OnClose (object sender, EventArgs e) {
758 // The module dtor will take care of things
764 // The following functions are only for the Mono Debugger.
767 [MethodImplAttribute (MethodImplOptions.InternalCall)]
768 internal static extern int MonoDebugger_GetMethodToken (MethodBase method);
770 [MonoTODO ("Currently it always returns zero")]
773 #if NET_4_0 || MOONLIGHT || MOBILE
781 internal virtual Module GetManifestModule () {
782 return GetManifestModuleInternal ();
785 [MethodImplAttribute (MethodImplOptions.InternalCall)]
786 internal extern Module GetManifestModuleInternal ();
789 public virtual extern bool ReflectionOnly {
790 [MethodImplAttribute (MethodImplOptions.InternalCall)]
794 public override int GetHashCode ()
796 return base.GetHashCode ();
799 public override bool Equals (object o)
801 if (((object) this) == o)
807 Assembly other = (Assembly) o;
808 return other._mono_assembly == _mono_assembly;
812 // Code Access Security
814 internal void Resolve ()
817 // FIXME: As we (currently) delay the resolution until the first CAS
818 // Demand it's too late to evaluate the Minimum permission set as a
819 // condition to load the assembly into the AppDomain
820 LoadAssemblyPermissions ();
821 Evidence e = new Evidence (UnprotectedGetEvidence ()); // we need a copy to add PRE
822 e.AddHost (new PermissionRequestEvidence (_minimum, _optional, _refuse));
823 _granted = SecurityManager.ResolvePolicy (e,
824 _minimum, _optional, _refuse, out _denied);
828 internal PermissionSet GrantedPermissionSet {
830 if (_granted == null) {
831 if (SecurityManager.ResolvingPolicyLevel != null) {
832 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
833 return DefaultPolicies.FullTrust;
835 return null; // we can't resolve during resolution
843 internal PermissionSet DeniedPermissionSet {
845 // yes we look for granted, as denied may be null
846 if (_granted == null) {
847 if (SecurityManager.ResolvingPolicyLevel != null) {
848 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
851 return DefaultPolicies.FullTrust; // deny unrestricted
859 [MethodImplAttribute (MethodImplOptions.InternalCall)]
860 extern internal static bool LoadPermissions (Assembly a,
861 ref IntPtr minimum, ref int minLength,
862 ref IntPtr optional, ref int optLength,
863 ref IntPtr refused, ref int refLength);
865 // Support for SecurityAction.RequestMinimum, RequestOptional and RequestRefuse
866 private void LoadAssemblyPermissions ()
868 IntPtr minimum = IntPtr.Zero, optional = IntPtr.Zero, refused = IntPtr.Zero;
869 int minLength = 0, optLength = 0, refLength = 0;
870 if (LoadPermissions (this, ref minimum, ref minLength, ref optional,
871 ref optLength, ref refused, ref refLength)) {
873 // Note: no need to cache these permission sets as they will only be created once
874 // at assembly resolution time.
876 byte[] data = new byte [minLength];
877 Marshal.Copy (minimum, data, 0, minLength);
878 _minimum = SecurityManager.Decode (data);
881 byte[] data = new byte [optLength];
882 Marshal.Copy (optional, data, 0, optLength);
883 _optional = SecurityManager.Decode (data);
886 byte[] data = new byte [refLength];
887 Marshal.Copy (refused, data, 0, refLength);
888 _refuse = SecurityManager.Decode (data);
895 public virtual PermissionSet PermissionSet {
896 get { return this.GrantedPermissionSet; }
899 public virtual SecurityRuleSet SecurityRuleSet {
900 get { throw CreateNIE (); }
904 #if NET_4_0 || MOONLIGHT || MOBILE
905 static Exception CreateNIE ()
907 return new NotImplementedException ("Derived classes must implement it");
910 public virtual IList<CustomAttributeData> GetCustomAttributesData ()
912 return CustomAttributeData.GetCustomAttributes (this);
916 public bool IsFullyTrusted {
920 public virtual Type GetType (string name, bool throwOnError, bool ignoreCase)
925 public virtual Module GetModule (String name)
930 public virtual AssemblyName[] GetReferencedAssemblies ()
935 public virtual Module[] GetModules (bool getResourceModules)
940 [MonoTODO ("Always returns the same as GetModules")]
941 public virtual Module[] GetLoadedModules (bool getResourceModules)
946 public virtual Assembly GetSatelliteAssembly (CultureInfo culture)
951 public virtual Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
956 public virtual Module ManifestModule {
957 get { throw CreateNIE (); }
960 public virtual bool GlobalAssemblyCache {
961 get { throw CreateNIE (); }
964 public virtual bool IsDynamic {
965 get { return false; }
968 public static bool operator == (Assembly left, Assembly right)
970 if ((object)left == (object)right)
972 if ((object)left == null ^ (object)right == null)
974 return left.Equals (right);
977 public static bool operator != (Assembly left, Assembly right)
979 if ((object)left == (object)right)
981 if ((object)left == null ^ (object)right == null)
983 return !left.Equals (right);