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, IEvidenceFactory, ISerializable {
57 public partial class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
59 internal class ResolveEventHolder {
60 public event ModuleResolveEventHandler ModuleResolve;
63 // Note: changes to fields must be reflected in _MonoReflectionAssembly struct (object-internals.h)
64 #pragma warning disable 649
65 private IntPtr _mono_assembly;
66 #pragma warning restore 649
68 private ResolveEventHolder resolve_event_holder;
70 private Evidence _evidence;
71 internal PermissionSet _minimum; // for SecurityAction.RequestMinimum
72 internal PermissionSet _optional; // for SecurityAction.RequestOptional
73 internal PermissionSet _refuse; // for SecurityAction.RequestRefuse
74 private PermissionSet _granted; // for the resolved assembly granted permissions
75 private PermissionSet _denied; // for the resolved assembly denied permissions
77 private bool fromByteArray;
78 private string assemblyName;
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 ();
181 internal bool FromByteArray {
182 set { fromByteArray = value; }
185 public virtual String Location {
190 string loc = get_location ();
192 if ((loc != String.Empty) && SecurityManager.SecurityEnabled) {
193 // we cannot divulge local file informations
194 new FileIOPermission (FileIOPermissionAccess.PathDiscovery, loc).Demand ();
202 public virtual string ImageRuntimeVersion {
204 return InternalImageRuntimeVersion ();
208 [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
209 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
212 throw new ArgumentNullException ("info");
214 UnitySerializationHolder.GetAssemblyData (this, info, context);
217 public virtual bool IsDefined (Type attributeType, bool inherit)
219 return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
222 public virtual object [] GetCustomAttributes (bool inherit)
224 return MonoCustomAttrs.GetCustomAttributes (this, inherit);
227 public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
229 return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
232 [MethodImplAttribute (MethodImplOptions.InternalCall)]
233 private extern object GetFilesInternal (String name, bool getResourceModules);
235 public virtual FileStream[] GetFiles ()
237 return GetFiles (false);
240 public virtual FileStream [] GetFiles (bool getResourceModules)
242 string[] names = (string[]) GetFilesInternal (null, getResourceModules);
244 return EmptyArray<FileStream>.Value;
246 string location = Location;
249 if (location != String.Empty) {
250 res = new FileStream [names.Length + 1];
251 res [0] = new FileStream (location, FileMode.Open, FileAccess.Read);
252 for (int i = 0; i < names.Length; ++i)
253 res [i + 1] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
255 res = new FileStream [names.Length];
256 for (int i = 0; i < names.Length; ++i)
257 res [i] = new FileStream (names [i], FileMode.Open, FileAccess.Read);
262 public virtual FileStream GetFile (String name)
265 throw new ArgumentNullException (null, "Name cannot be null.");
266 if (name.Length == 0)
267 throw new ArgumentException ("Empty name is not valid");
269 string filename = (string)GetFilesInternal (name, true);
270 if (filename != null)
271 return new FileStream (filename, FileMode.Open, FileAccess.Read);
276 [MethodImplAttribute (MethodImplOptions.InternalCall)]
277 internal extern IntPtr GetManifestResourceInternal (String name, out int size, out Module module);
279 public virtual Stream GetManifestResourceStream (String name)
282 throw new ArgumentNullException ("name");
283 if (name.Length == 0)
284 throw new ArgumentException ("String cannot have zero length.",
287 ManifestResourceInfo info = GetManifestResourceInfo (name);
289 Assembly a = AppDomain.CurrentDomain.DoResourceResolve (name, this);
290 if (a != null && a != this)
291 return a.GetManifestResourceStream (name);
296 if (info.ReferencedAssembly != null)
297 return info.ReferencedAssembly.GetManifestResourceStream (name);
298 if ((info.FileName != null) && (info.ResourceLocation == 0)) {
300 throw new FileNotFoundException (info.FileName);
302 string location = Path.GetDirectoryName (Location);
303 string filename = Path.Combine (location, info.FileName);
304 return new FileStream (filename, FileMode.Open, FileAccess.Read);
309 IntPtr data = GetManifestResourceInternal (name, out size, out module);
310 if (data == (IntPtr) 0)
313 UnmanagedMemoryStream stream;
315 stream = new UnmanagedMemoryStream ((byte*) data, size);
318 * The returned pointer points inside metadata, so
319 * we have to increase the refcount of the module, and decrease
320 * it when the stream is finalized.
322 stream.Closed += new EventHandler (new ResourceCloseHandler (module).OnClose);
327 public virtual Stream GetManifestResourceStream (Type type, String name)
334 throw new ArgumentNullException ("type");
338 if (ns == null || ns.Length == 0)
339 return GetManifestResourceStream (name);
341 return GetManifestResourceStream (ns + "." + name);
344 [MethodImplAttribute (MethodImplOptions.InternalCall)]
345 internal virtual extern Type[] GetTypes (bool exportedOnly);
347 public virtual Type[] GetTypes ()
349 return GetTypes (false);
352 public virtual Type[] GetExportedTypes ()
354 return GetTypes (true);
357 public virtual Type GetType (String name, Boolean throwOnError)
359 return GetType (name, throwOnError, false);
362 public virtual Type GetType (String name) {
363 return GetType (name, false, false);
366 [MethodImplAttribute (MethodImplOptions.InternalCall)]
367 internal extern Type InternalGetType (Module module, String name, Boolean throwOnError, Boolean ignoreCase);
369 [MethodImplAttribute (MethodImplOptions.InternalCall)]
370 internal extern static void InternalGetAssemblyName (string assemblyFile, AssemblyName aname);
372 [MethodImplAttribute (MethodImplOptions.InternalCall)]
373 static extern void FillName (Assembly ass, AssemblyName aname);
375 [MonoTODO ("copiedName == true is not supported")]
376 public virtual AssemblyName GetName (Boolean copiedName)
378 // CodeBase, which is restricted, will be copied into the AssemblyName object so...
379 if (SecurityManager.SecurityEnabled) {
380 GetCodeBase (true); // this will ensure the Demand is made
382 return UnprotectedGetName ();
385 public virtual AssemblyName GetName ()
387 return GetName (false);
390 // the security runtime requires access to the assemblyname (e.g. to get the strongname)
391 internal virtual AssemblyName UnprotectedGetName ()
393 AssemblyName aname = new AssemblyName ();
394 FillName (this, aname);
398 public override string ToString ()
400 // note: ToString work without requiring CodeBase (so no checks are needed)
402 if (assemblyName != null)
405 assemblyName = get_fullname ();
409 public static String CreateQualifiedName (String assemblyName, String typeName)
411 return typeName + ", " + assemblyName;
414 public static Assembly GetAssembly (Type type)
417 return type.Assembly;
418 throw new ArgumentNullException ("type");
422 [MethodImplAttribute (MethodImplOptions.InternalCall)]
423 public static extern Assembly GetEntryAssembly();
425 internal Assembly GetSatelliteAssemblyNoThrow (CultureInfo culture, Version version)
427 return GetSatelliteAssembly (culture, version, false);
430 internal Assembly GetSatelliteAssembly (CultureInfo culture, Version version, bool throwOnError)
433 throw new ArgumentException ("culture");
435 AssemblyName aname = GetName (true);
437 aname.Version = version;
439 aname.CultureInfo = culture;
440 aname.Name = aname.Name + ".resources";
444 assembly = AppDomain.CurrentDomain.LoadSatellite (aname, false);
445 if (assembly != null)
447 } catch (FileNotFoundException) {
452 // Try the assembly directory
453 string location = Path.GetDirectoryName (Location);
454 string fullName = Path.Combine (location, Path.Combine (culture.Name, aname.Name + ".dll"));
455 if (!throwOnError && !File.Exists (fullName))
458 return LoadFrom (fullName);
461 Type _Assembly.GetType ()
463 // Required or object::GetType becomes virtual final
464 return base.GetType ();
467 [MethodImplAttribute (MethodImplOptions.InternalCall)]
468 private extern static Assembly LoadFrom (String assemblyFile, bool refonly);
470 public static Assembly LoadFrom (String assemblyFile)
472 return LoadFrom (assemblyFile, false);
478 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
480 Assembly a = LoadFrom (assemblyFile, false);
482 if ((a != null) && (securityEvidence != null)) {
483 // merge evidence (i.e. replace defaults with provided evidences)
484 a.Evidence.Merge (securityEvidence);
493 [MonoTODO("This overload is not currently implemented")]
494 // FIXME: What are we missing?
495 public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
497 throw new NotImplementedException ();
502 public static Assembly LoadFrom (String assemblyFile, byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm)
504 throw new NotImplementedException ();
509 public static Assembly UnsafeLoadFrom (String assemblyFile)
511 return LoadFrom (assemblyFile);
518 public static Assembly LoadFile (String path, Evidence securityEvidence)
521 throw new ArgumentNullException ("path");
522 if (path == String.Empty)
523 throw new ArgumentException ("Path can't be empty", "path");
524 // FIXME: Make this do the right thing
525 return LoadFrom (path, securityEvidence);
528 public static Assembly LoadFile (String path)
530 return LoadFile (path, null);
533 public static Assembly Load (String assemblyString)
535 return AppDomain.CurrentDomain.Load (assemblyString);
541 public static Assembly Load (String assemblyString, Evidence assemblySecurity)
543 return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
546 public static Assembly Load (AssemblyName assemblyRef)
548 return AppDomain.CurrentDomain.Load (assemblyRef);
554 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
556 return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
559 public static Assembly Load (Byte[] rawAssembly)
561 return AppDomain.CurrentDomain.Load (rawAssembly);
564 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
566 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
572 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
573 Evidence securityEvidence)
575 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
579 [MonoLimitation ("Argument securityContextSource is ignored")]
580 public static Assembly Load (byte [] rawAssembly, byte [] rawSymbolStore, SecurityContextSource securityContextSource)
582 return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
586 public static Assembly ReflectionOnlyLoad (byte[] rawAssembly)
588 return AppDomain.CurrentDomain.Load (rawAssembly, null, null, true);
591 public static Assembly ReflectionOnlyLoad (string assemblyString)
593 return AppDomain.CurrentDomain.Load (assemblyString, null, true);
596 public static Assembly ReflectionOnlyLoadFrom (string assemblyFile)
598 if (assemblyFile == null)
599 throw new ArgumentNullException ("assemblyFile");
601 return LoadFrom (assemblyFile, true);
605 public static Assembly LoadWithPartialName (string partialName)
607 return LoadWithPartialName (partialName, null);
610 [MonoTODO ("Not implemented")]
611 public Module LoadModule (string moduleName, byte [] rawModule)
613 throw new NotImplementedException ();
616 [MonoTODO ("Not implemented")]
621 Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
623 throw new NotImplementedException ();
626 [MethodImplAttribute (MethodImplOptions.InternalCall)]
627 private static extern Assembly load_with_partial_name (string name, Evidence e);
630 public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
632 return LoadWithPartialName (partialName, securityEvidence, true);
636 * LAMESPEC: It is possible for this method to throw exceptions IF the name supplied
637 * is a valid gac name and contains filesystem entry charachters at the end of the name
638 * ie System/// will throw an exception. However ////System will not as that is canocolized
642 // FIXME: LoadWithPartialName must look cache (no CAS) or read from disk (CAS)
643 internal static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
646 throw new NotImplementedException ();
648 if (partialName == null)
649 throw new NullReferenceException ();
651 return load_with_partial_name (partialName, securityEvidence);
654 public Object CreateInstance (String typeName)
656 return CreateInstance (typeName, false);
659 public Object CreateInstance (String typeName, Boolean ignoreCase)
661 Type t = GetType (typeName, false, ignoreCase);
666 return Activator.CreateInstance (t);
667 } catch (InvalidOperationException) {
668 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
676 Object CreateInstance (String typeName, Boolean ignoreCase,
677 BindingFlags bindingAttr, Binder binder,
678 Object[] args, CultureInfo culture,
679 Object[] activationAttributes)
681 Type t = GetType (typeName, false, ignoreCase);
686 return Activator.CreateInstance (t, bindingAttr, binder, args, culture, activationAttributes);
687 } catch (InvalidOperationException) {
688 throw new ArgumentException ("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
692 public Module[] GetLoadedModules ()
694 return GetLoadedModules (false);
697 public Module[] GetModules ()
699 return GetModules (false);
702 [MethodImplAttribute (MethodImplOptions.InternalCall)]
703 internal virtual extern Module[] GetModulesInternal ();
706 [MethodImplAttribute (MethodImplOptions.InternalCall)]
707 internal extern string[] GetNamespaces ();
709 [MethodImplAttribute (MethodImplOptions.InternalCall)]
710 public extern virtual String[] GetManifestResourceNames ();
712 [MethodImplAttribute (MethodImplOptions.InternalCall)]
713 public extern static Assembly GetExecutingAssembly ();
715 [MethodImplAttribute (MethodImplOptions.InternalCall)]
716 public extern static Assembly GetCallingAssembly ();
718 [MethodImplAttribute (MethodImplOptions.InternalCall)]
719 internal static extern AssemblyName[] GetReferencedAssemblies (Assembly module);
721 [MethodImplAttribute (MethodImplOptions.InternalCall)]
722 private extern bool GetManifestResourceInfoInternal (String name, ManifestResourceInfo info);
724 public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
726 if (resourceName == null)
727 throw new ArgumentNullException ("resourceName");
728 if (resourceName.Length == 0)
729 throw new ArgumentException ("String cannot have zero length.");
730 ManifestResourceInfo result = new ManifestResourceInfo ();
731 bool found = GetManifestResourceInfoInternal (resourceName, result);
738 private class ResourceCloseHandler {
739 #pragma warning disable 169, 414
741 #pragma warning restore 169, 414
743 public ResourceCloseHandler (Module module) {
744 this.module = module;
747 public void OnClose (object sender, EventArgs e) {
748 // The module dtor will take care of things
754 // The following functions are only for the Mono Debugger.
757 [MethodImplAttribute (MethodImplOptions.InternalCall)]
758 internal static extern int MonoDebugger_GetMethodToken (MethodBase method);
760 [MonoTODO ("Currently it always returns zero")]
771 internal virtual Module GetManifestModule () {
772 return GetManifestModuleInternal ();
775 [MethodImplAttribute (MethodImplOptions.InternalCall)]
776 internal extern Module GetManifestModuleInternal ();
779 public virtual extern bool ReflectionOnly {
780 [MethodImplAttribute (MethodImplOptions.InternalCall)]
784 public override int GetHashCode ()
786 return base.GetHashCode ();
789 public override bool Equals (object o)
791 if (((object) this) == o)
797 Assembly other = (Assembly) o;
798 return other._mono_assembly == _mono_assembly;
802 // Code Access Security
804 internal void Resolve ()
807 // FIXME: As we (currently) delay the resolution until the first CAS
808 // Demand it's too late to evaluate the Minimum permission set as a
809 // condition to load the assembly into the AppDomain
810 LoadAssemblyPermissions ();
811 Evidence e = new Evidence (UnprotectedGetEvidence ()); // we need a copy to add PRE
812 e.AddHost (new PermissionRequestEvidence (_minimum, _optional, _refuse));
813 _granted = SecurityManager.ResolvePolicy (e,
814 _minimum, _optional, _refuse, out _denied);
818 internal PermissionSet GrantedPermissionSet {
820 if (_granted == null) {
821 if (SecurityManager.ResolvingPolicyLevel != null) {
822 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
823 return DefaultPolicies.FullTrust;
825 return null; // we can't resolve during resolution
833 internal PermissionSet DeniedPermissionSet {
835 // yes we look for granted, as denied may be null
836 if (_granted == null) {
837 if (SecurityManager.ResolvingPolicyLevel != null) {
838 if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly (this))
841 return DefaultPolicies.FullTrust; // deny unrestricted
849 [MethodImplAttribute (MethodImplOptions.InternalCall)]
850 extern internal static bool LoadPermissions (Assembly a,
851 ref IntPtr minimum, ref int minLength,
852 ref IntPtr optional, ref int optLength,
853 ref IntPtr refused, ref int refLength);
855 // Support for SecurityAction.RequestMinimum, RequestOptional and RequestRefuse
856 private void LoadAssemblyPermissions ()
858 IntPtr minimum = IntPtr.Zero, optional = IntPtr.Zero, refused = IntPtr.Zero;
859 int minLength = 0, optLength = 0, refLength = 0;
860 if (LoadPermissions (this, ref minimum, ref minLength, ref optional,
861 ref optLength, ref refused, ref refLength)) {
863 // Note: no need to cache these permission sets as they will only be created once
864 // at assembly resolution time.
866 byte[] data = new byte [minLength];
867 Marshal.Copy (minimum, data, 0, minLength);
868 _minimum = SecurityManager.Decode (data);
871 byte[] data = new byte [optLength];
872 Marshal.Copy (optional, data, 0, optLength);
873 _optional = SecurityManager.Decode (data);
876 byte[] data = new byte [refLength];
877 Marshal.Copy (refused, data, 0, refLength);
878 _refuse = SecurityManager.Decode (data);
884 public virtual PermissionSet PermissionSet {
885 get { return this.GrantedPermissionSet; }
888 public virtual SecurityRuleSet SecurityRuleSet {
889 get { throw CreateNIE (); }
896 static Exception CreateNIE ()
898 return new NotImplementedException ("Derived classes must implement it");
901 public virtual IList<CustomAttributeData> GetCustomAttributesData ()
903 return CustomAttributeData.GetCustomAttributes (this);
907 public bool IsFullyTrusted {
911 public virtual Type GetType (string name, bool throwOnError, bool ignoreCase)
916 public virtual Module GetModule (String name)
921 public virtual AssemblyName[] GetReferencedAssemblies ()
926 public virtual Module[] GetModules (bool getResourceModules)
931 [MonoTODO ("Always returns the same as GetModules")]
932 public virtual Module[] GetLoadedModules (bool getResourceModules)
937 public virtual Assembly GetSatelliteAssembly (CultureInfo culture)
942 public virtual Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
947 public virtual Module ManifestModule {
948 get { throw CreateNIE (); }
951 public virtual bool GlobalAssemblyCache {
952 get { throw CreateNIE (); }
955 public virtual bool IsDynamic {
956 get { return false; }
959 public static bool operator == (Assembly left, Assembly right)
961 if ((object)left == (object)right)
963 if ((object)left == null ^ (object)right == null)
965 return left.Equals (right);
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);