how to merge dlls into one dll and create nuget package

This is batch file..

Example

##@ Echo off

# set current directory using below cd command
set currentDir=%cd%

# set path to some temp variable, as we need to set it back to its old 

value after our operation is done. set oldPath=%PATH% # now append/combine system environment path variable and our current directory path set PATH=%PATH%;C:\Program Files (x86)\Microsoft\ILMerge;.;%currentDir%\..\App\Source\.nuget @Echo on MD .\App\Lib\net40 MD .\Messaging\Lib\net40 # this is where we are merging the two or more dll in one single dll or binary # /out: for output dll name along with relative path # /t: for library or exe # /log: for text log # /V4 specify the dlls..... iLMerge.exe /out:./Lib/net40/AllinOneMergedDll.dll /t:library /log:MergeLog.txt /V4 C:\testproject1\bin\Debug\testproject1.dll C:\testproject1\bin\Debug\testproject2.dll C:\testproject1\bin\Debug\testproject3.dll cd .. @ Echo off # finally we are going to reset environment variable path back to its original value set PATH=%oldPath%

Copy and Try it