Пример #1
0
        /// <summary>
        /// Facade for AppDomain.GetAssemblies
        /// </summary>
        /// <param name="namespaceQualifiedTypeName">
        /// In CoreCLR context, if it's for string-to-type conversion and the namespace qualified type name is known, pass it in so that
        /// powershell can load the necessary TPA if the target type is from an unloaded TPA.
        /// </param>
        internal static IEnumerable <Assembly> GetAssemblies(string namespaceQualifiedTypeName = null)
        {
            return
                (#if CORECLR
                 PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ??
#endif
                 AppDomain.CurrentDomain.GetAssemblies().Where(a => !(a.FullName.Length > 0 && a.FullName[0] == FIRST_CHAR_PSASSEMBLY_MARK)));
        }
Пример #2
0
 /// <summary>
 /// Facade for AppDomain.GetAssemblies
 /// </summary>
 /// <param name="namespaceQualifiedTypeName">
 /// In CoreCLR context, if it's for string-to-type conversion and the namespace qualified type name is known, pass it in so that
 /// powershell can load the necessary TPA if the target type is from an unloaded TPA.
 /// </param>
 internal static IEnumerable <Assembly> GetAssemblies(string namespaceQualifiedTypeName = null)
 {
     return(PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ??
            AppDomain.CurrentDomain.GetAssemblies().Where(a =>
                                                          !TypeDefiner.DynamicClassAssemblyName.Equals(a.GetName().Name, StringComparison.Ordinal)));
 }
Пример #3
0
 /// <summary>
 /// Facade for AppDomain.GetAssemblies.
 /// </summary>
 /// <param name="namespaceQualifiedTypeName">
 /// In CoreCLR context, if it's for string-to-type conversion and the namespace qualified type name is known, pass it in so that
 /// powershell can load the necessary TPA if the target type is from an unloaded TPA.
 /// </param>
 internal static IEnumerable <Assembly> GetAssemblies(string namespaceQualifiedTypeName = null)
 {
     return(PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ?? GetPSVisibleAssemblies());
 }
Пример #4
0
 /// <summary>
 /// Facade for AppDomain.GetAssemblies.
 /// </summary>
 /// <param name="namespaceQualifiedTypeName">
 /// In CoreCLR context, if it's for string-to-type conversion and the namespace qualified type name is known, pass it in so that
 /// powershell can load the necessary TPA if the target type is from an unloaded TPA.
 /// </param>
 internal static IEnumerable <Assembly> GetAssemblies(string namespaceQualifiedTypeName = null)
 {
     return(PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ??
            AssemblyLoadContext.Default.Assemblies.Where(a =>
                                                         !a.FullName.StartsWith(TypeDefiner.DynamicClassAssemblyFullNamePrefix, StringComparison.Ordinal)));
 }