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();
		}
        protected override void ExecuteTask()
        {
            ILMerge = new ILRepack();
            ILMerge.AttributeFile = m_attributeFile;
            ILMerge.Closed = m_closed;
            ILMerge.CopyAttributes = m_copyAttributes;
            ILMerge.DebugInfo = m_debugInfo;
            ILMerge.ExcludeFile = m_excludeFile;
            ILMerge.Internalize = m_internalize;
            ILMerge.LogFile = m_logFile;
            ILMerge.Log = m_log;
            ILMerge.OutputFile = m_outputFile;
            ILMerge.KeyFile = m_keyFile;

            switch (m_targetKind.ToLower())
            {
                case "winexe":
                    ILMerge.TargetKind = ILRepack.Kind.WinExe; break;
                case "exe":
                    ILMerge.TargetKind = ILRepack.Kind.Exe; break;
                case "dll":
                    ILMerge.TargetKind = ILRepack.Kind.Dll; break;
                case "sameasprimary":
                    ILMerge.TargetKind = ILRepack.Kind.SameAsPrimaryAssembly;
                    break;
                default:
                    throw new BuildException(
                        "TargetKind should be [exe|dll|winexe|sameasprimary]");
            }

            string[] assemblies = new string[m_assemblies.FileNames.Count + 1];
            if (this.m_primaryAssembly.FileNames.Count != 1)
            {
                this.Log(Level.Error, "Only one primary assembly is allowed in the <primaryassembly> fileset, but found {0}.", this.m_primaryAssembly.FileNames.Count);
                return;
            }
            assemblies[0] = this.m_primaryAssembly.FileNames[0];
            for (int i = 1; i < assemblies.Length; i++)
            {
                assemblies[i] = m_assemblies.FileNames[i-1];
            }

            ILMerge.SetInputAssemblies(assemblies);

            List<string> searchPath = new List<string>();
            searchPath.Add(".");
            if (LibraryPath != null) {
               foreach (string libpath in LibraryPath.FileNames) {
                  searchPath.Add(libpath);
               }
            }
            ILMerge.SetSearchDirectories(searchPath.ToArray());

            try
            {
                this.Log(Level.Info, "Merging {0} assembl{1} to '{2}'.", this.m_assemblies.FileNames.Count, (this.m_assemblies.FileNames.Count != 1) ? "ies" : "y", this.m_outputFile);
                ILMerge.Merge();
            }
            catch (Exception e)
            {
                throw new BuildException("Failed to merge assemblies", e);
            }
        }