<Member Name="GetReferencedAssemblies" />
<Member Name="get_EntryPoint" />
<Member Name="get_FullName" />
+ <Member Name="get_GlobalAssemblyCache" />
+ <Member Name="get_HostContext" />
<Member Name="get_ImageRuntimeVersion" />
+ <Member Name="get_IsFullyTrusted" />
<Member Name="get_IsDynamic" />
<Member Name="get_CodeBase" />
<Member Name="get_Location" />
<Member Name="get_CustomAttributes" />
<Member Name="get_Modules" />
<Member Name="get_ReflectionOnly" />
+ <Member Name="get_SecurityRuleSet" />
<Member Name="GetAssembly(System.Type)" />
<Member Name="op_Equality(System.Reflection.Assembly,System.Reflection.Assembly)" />
<Member Name="op_Inequality(System.Reflection.Assembly,System.Reflection.Assembly)" />
<Member Name="Load(System.String)" />
<Member Name="Load(System.Byte[])" />
<Member Name="Load(System.Byte[],System.Byte[])" />
+ <Member Name="LoadFile(System.String)" />
+ <Member Name="LoadFrom(System.String)" />
+ <Member Name="LoadFrom(System.String,System.Byte[],System.Configuration.Assemblies.AssemblyHashAlgorithm)" />
+ <Member Name="LoadModule(System.String,System.Byte[])" />
+ <Member Name="LoadModule(System.String,System.Byte[],System.Byte[])" />
+ <Member Name="LoadWithPartialName(System.String)" />
<Member Name="ReflectionOnlyLoad(System.String)" />
<Member Name="ReflectionOnlyLoad(System.Byte[])" />
<Member Name="ReflectionOnlyLoadFrom(System.String)" />
<Member Name="ToString" />
+ <Member Name="UnsafeLoadFrom(System.String)" />
<Member MemberType="Property" Name="DefinedTypes" />
<Member MemberType="Property" Name="CustomAttributes" />
<Member MemberType="Property" Name="Modules" />
<Member MemberType="Property" Name="ExportedTypes" />
<Member MemberType="Property" Name="EntryPoint" />
<Member MemberType="Property" Name="FullName" />
+ <Member MemberType="Property" Name="GlobalAssemblyCache" />
+ <Member MemberType="Property" Name="HostContext" />
<Member MemberType="Property" Name="CodeBase" />
<Member MemberType="Property" Name="ImageRuntimeVersion" />
+ <Member MemberType="Property" Name="IsFullyTrusted" />
<Member MemberType="Property" Name="Location" />
<Member MemberType="Property" Name="ManifestModule" />
+ <Member MemberType="Property" Name="SecurityRuleSet" />
<Member Status="ImplRoot" MemberType="Event" Name="ModuleResolve" />
</Type>
<Type Name="System.Reflection.IntrospectionExtensions">
public virtual System.Reflection.MethodInfo EntryPoint { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Type> ExportedTypes { get { throw null; } }
public virtual string FullName { get { throw null; } }
+ public virtual bool GlobalAssemblyCache { get { throw null; } }
+ public virtual Int64 HostContext { get { throw null; } }
[System.Runtime.InteropServices.ComVisibleAttribute(false)]
public virtual string ImageRuntimeVersion { get { throw null; } }
public virtual bool IsDynamic { get { throw null; } }
+ public bool IsFullyTrusted { get { throw null; } }
public virtual string Location { [System.Security.SecurityCriticalAttribute]get { throw null; } }
[System.Runtime.InteropServices.ComVisibleAttribute(false)]
public virtual System.Reflection.Module ManifestModule { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.Module> Modules { get { throw null; } }
[System.Runtime.InteropServices.ComVisibleAttribute(false)]
public virtual bool ReflectionOnly { get { throw null; } }
+ public virtual System.Security.SecurityRuleSet SecurityRuleSet { get { throw null; } }
public object CreateInstance(string typeName) { throw null; }
public object CreateInstance(string typeName, bool ignoreCase) { throw null; }
public virtual object CreateInstance(String typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, System.Globalization.CultureInfo culture, Object[] activationAttributes) { throw null; }
public static System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyRef) { throw null; }
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)][System.Security.SecuritySafeCriticalAttribute]
public static System.Reflection.Assembly Load(string assemblyString) { throw null; }
+ public static System.Reflection.Assembly LoadFile(String path) { throw null; }
+ public static System.Reflection.Assembly LoadFrom(String path) { throw null; }
+ public static Assembly LoadFrom(string assemblyFile, byte[] hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm) { throw null; }
+ public System.Reflection.Module LoadModule(String moduleName, byte[] rawModule) { throw null; }
+ public System.Reflection.Module LoadModule(String moduleName, byte[] rawModule, byte[] rawSymbolStore) { throw null; }
+ [ObsoleteAttribute("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
+ public static Assembly LoadWithPartialName(string partialName) { throw null; }
[System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public static Assembly ReflectionOnlyLoad(byte[] rawAssembly) { throw null; }
[System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
[System.Security.SecuritySafeCriticalAttribute][System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
public static Assembly ReflectionOnlyLoadFrom(string assemblyFile) { throw null; }
public override string ToString() { throw null; }
+ public static Assembly UnsafeLoadFrom(string assemblyFile) { throw null; }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(1), Inherited=false)]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
; Not referring to "Windows Phone" in the messages, as FEATURE_WINDOWSPHONE is defined for .NET Core as well.
NotSupported_WindowsPhone = {0} is not supported.
NotSupported_AssemblyLoadCodeBase = Assembly.Load with a Codebase is not supported.
+NotSupported_AssemblyLoadFromHash = Assembly.LoadFrom with hashValue is not supported.
#endif
; TypeLoadException
using __HResults = System.__HResults;
using System.Runtime.Versioning;
using System.Diagnostics.Contracts;
+ using System.Runtime.Loader;
[Serializable]
return base.GetHashCode();
}
- // Locate an assembly by the name of the file containing the manifest.
#if FEATURE_CORECLR
- [System.Security.SecurityCritical] // auto-generated
+ [System.Security.SecurityCritical]
+ public static Assembly LoadFrom(String assemblyFile)
+ {
+ if(assemblyFile == null)
+ throw new ArgumentNullException("assemblyFile");
+ string fullPath = Path.GetFullPathInternal(assemblyFile);
+ return AssemblyLoadContext.Default.LoadFromAssemblyPath(fullPath);
+ }
#else
+ // Locate an assembly by the name of the file containing the manifest.
[System.Security.SecuritySafeCritical]
-#endif
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile)
{
Contract.Ensures(Contract.Result<Assembly>() != null);
Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-#if FEATURE_WINDOWSPHONE
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_WindowsPhone", "Assembly.LoadFrom"));
-#else
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
false,// forIntrospection
false,// suppressSecurityChecks
ref stackMark);
-#endif // FEATURE_WINDOWSPHONE
}
+#endif
// Locate an assembly for reflection by the name of the file containing the manifest.
[System.Security.SecuritySafeCritical] // auto-generated
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
{
+#if FEATURE_CORECLR
+ throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadFromHash"));
+#else
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
false,
false,
ref stackMark);
+#endif
}
#if FEATURE_CAS_POLICY
true, // suppressSecurityChecks
ref stackMark);
}
+#elif FEATURE_CORECLR
+ [SecurityCritical]
+ public static Assembly UnsafeLoadFrom(string assemblyFile)
+ {
+ return LoadFrom(assemblyFile);
+ }
#endif // FEATURE_CAS_POLICY
// Locate an assembly by the long form of the assembly name.
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.LoadWithPartialNameInternal(partialName, securityEvidence, ref stackMark);
}
+#elif FEATURE_CORECLR
+ [System.Security.SecuritySafeCritical] // auto-generated
+ [Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
+ public static Assembly LoadWithPartialName(String partialName)
+ {
+ if(partialName == null)
+ throw new ArgumentNullException("partialName");
+ return Load(partialName);
+ }
+
#endif // FEATURE_FUSION
// Loads the assembly with a COFF based IMAGE containing
AppDomain.CheckLoadByteArraySupported();
+#if FEATURE_CORECLR
+ return Load(rawAssembly, null);
+#else
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
ref stackMark,
false, // fIntrospection
SecurityContextSource.CurrentAssembly);
+#endif
}
// Loads the assembly for reflection with a COFF based IMAGE containing
AppDomain.CheckLoadByteArraySupported();
+#if FEATURE_CORECLR
+ if(rawAssembly == null)
+ throw new ArgumentNullException("rawAssembly");
+ AssemblyLoadContext alc = new FileLoadAssemblyLoadContext();
+ MemoryStream assemblyStream = new MemoryStream(rawAssembly);
+ MemoryStream symbolStream = (rawSymbolStore==null)?new MemoryStream(rawSymbolStore):null;
+ return alc.LoadFromStream(assemblyStream, symbolStream);
+#else
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
ref stackMark,
false, // fIntrospection
SecurityContextSource.CurrentAssembly);
+#endif
}
// Load an assembly from a byte array, controlling where the grant set of this assembly is
}
#endif // FEATURE_CAS_POLICY
+#if FEATURE_CORECLR
+ private static Dictionary<string, Assembly> s_loadfile = new Dictionary<string, Assembly>();
+#endif
+
[System.Security.SecuritySafeCritical] // auto-generated
public static Assembly LoadFile(String path)
{
AppDomain.CheckLoadFileSupported();
+#if FEATURE_CORECLR
+ Assembly result = null;
+ if(path == null)
+ throw new ArgumentNullException("path");
+
+ if (Path.IsRelative(path))
+ {
+ throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), "path");
+ }
+
+ string normalizedPath = Path.GetFullPathInternal(path);
+
+ lock(s_loadfile)
+ {
+ if(s_loadfile.TryGetValue(normalizedPath, out result))
+ return result;
+ AssemblyLoadContext alc = new FileLoadAssemblyLoadContext();
+ result = alc.LoadFromAssemblyPath(normalizedPath);
+ s_loadfile.Add(normalizedPath, result);
+ }
+ return result;
+#else
new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, path).Demand();
return RuntimeAssembly.nLoadFile(path, null);
+#endif
}
#if FEATURE_CAS_POLICY
throw new NotImplementedException();
}
}
+#elif FEATURE_CORECLR
+ public bool IsFullyTrusted
+ {
+ [SecuritySafeCritical]
+ get
+ {
+ return true;
+ }
+ }
+ public virtual SecurityRuleSet SecurityRuleSet
+ {
+ get
+ {
+ return SecurityRuleSet.None;
+ }
+ }
#endif // FEATURE_CAS_POLICY
// ISerializable implementation
}
}
-#if FEATURE_MULTIMODULE_ASSEMBLIES
-
public Module LoadModule(String moduleName,
byte[] rawModule)
{
{
throw new NotImplementedException();
}
-#endif //FEATURE_MULTIMODULE_ASSEMBLIES
//
// Locates a type from this assembly and creates an instance of it using
[System.Security.SecuritySafeCritical] // auto-generated
get
{
+#if FEATURE_CORECLR
+ return false;
+#else
return IsGlobalAssemblyCache(GetNativeHandle());
+#endif
}
}
[System.Security.SecuritySafeCritical] // auto-generated
get
{
+#if FEATURE_CORECLR
+ return 0;
+#else
return GetHostContext(GetNativeHandle());
+#endif
}
}
return null;
}
}
+
+ [System.Security.SecuritySafeCritical]
+ internal class FileLoadAssemblyLoadContext : AssemblyLoadContext
+ {
+ internal FileLoadAssemblyLoadContext() : base(false)
+ {
+ }
+
+ [System.Security.SecuritySafeCritical]
+ protected override Assembly Load(AssemblyName assemblyName)
+ {
+ return null;
+ }
+ }
}
#endif // FEATURE_HOST_ASSEMBLY_RESOLVER