public static Type[] LoadPluginTypes(Assembly[] assemblies)
 {
     if (_logger.IsDebugEnabled)
     {
         _logger.Debug("Loading assemblies: {0}", String.Join(",", assemblies.Select(a => a.FullName)));
     }
     return assemblies.Select(assembly => assembly.GetCustomAttribute<AssemblyPluginDescriptorAttribute>()).Select(attr => attr.PluginType).ToArray();
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="WebPartsCatalog" /> class. Overloaded constructor allows caller to specify one or more assemblies and
		/// optionally MEF conventions for finding parts.
		/// </summary>
		/// <param name="assemblies">The assemblies.</param>
		/// <param name="reflectionContext">The reflection context.</param>
		public WebPartsCatalog(Assembly[] assemblies, ReflectionContext reflectionContext = null)
		{
			if (reflectionContext == null)
				reflectionContext = GetWebPartConventions();

			catalog = new AggregateCatalog(assemblies.Select(a => new AssemblyCatalog(a, reflectionContext)));
		}
Example #3
0
        private static Exception ResourceResolveException(string resourceFileName, Assembly callingAssembly, Assembly[] referencedAssemblies, Caller caller)
        {
            var referencedAssembliesNames = string.Join(", ", referencedAssemblies.Select(a => a.GetName().Name));
            var message = string.Format("Can't locate resource '{0}' in assembly '{1}' and it's referenced assemblies. Please, make sure resource file exists and is build as Embedded Resource.\r\n\r\n Resource resolution priority:\r\n1. First place where resource is supposed to be is in assembly '{1}' in '{2}' folder or in any of it's parent folders.\r\n2. Resolution proceeds in all referenced assemblies: {3}",
                                         resourceFileName, callingAssembly.GetName().Name, caller.GerNamespace(), referencedAssembliesNames);

            return new ResourceResolveException(message);
        }
 internal DkmClrRuntimeInstance(
     Assembly[] assemblies,
     GetModuleDelegate getModule = null,
     GetMemberValueDelegate getMemberValue = null)
 {
     if (getModule == null)
     {
         getModule = (r, a) => new DkmClrModuleInstance(r, a, (a != null) ? new DkmModule(a.GetName().Name + ".dll") : null);
     }
     this.Assemblies = assemblies;
     this.Modules = assemblies.Select(a => getModule(this, a)).Where(m => m != null).ToArray();
     _defaultModule = getModule(this, null);
     _appDomain = new DkmClrAppDomain(this);
     _getMemberValue = getMemberValue;
 }
		protected virtual void MergeStaticProxyFactoryWithProxies(Assembly staticProxyAssembly, Assembly proxyAssembly, Assembly[] referenceAssemblies, string outputPath)
		{
			foreach (var referenceAssembly in referenceAssemblies)
			{
				Console.WriteLine(referenceAssembly);
			}
			var merger = new ILRepack();

			var searchDirectories = referenceAssemblies.Select(a => Path.GetDirectoryName(a.Location))
				.Distinct()
				.ToArray();
			merger.SetSearchDirectories(searchDirectories);
			merger.SetInputAssemblies(new[] {staticProxyAssembly.Location, proxyAssembly.Location});
			merger.OutputFile = outputPath;
			merger.Merge();
		}