Articles → .NET → ILMerge utility

ILMerge utility






What is ILMerge utility?





Download





Click to Enlarge




Click to Enlarge


Example












namespace ILMergeLib {
	public class MyClass {
		public string SayHello(string name) {
			return string.Format("Hello {0}", name);
		}
	}
}









Click to Enlarge



using System;
using ILMergeLib;

namespace ILMergeDemo {
	class Program {
		static void Main(string[] args) {
			MyClass obj = new MyClass();
			Console.WriteLine(obj.SayHello("gyan"));
			Console.ReadLine();
		}
	}
}





Running the executable file







Click to Enlarge




Merging executable and DLL files









Click to Enlarge





"$(ProjectDir)ilmerge.exe" /target:exe /out:"$(TargetDir)ILMergeDemo_final.exe" "$(TargetDir)ILMergeDemo.exe" "$(TargetDir)ILMergeLib.dll" /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"



















Output





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, August 3, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250