為大家所知,ILMerge可用於合并.NET的程式集,但如何合并Silverlight,WindowsPhone或者Mono for Android的程式集呢?其實ILMerge命令參數targetplatform已經提供了對此項功能的支援。
ILMerge:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17630
使用ILMerge合并Silverlight程式集:
set srcdir=D:\Bin\Silverlight
set outdir=D:\Bin\Silverlight\Output
set sldir=%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
if not exist "%sldir%" (
set sldir=%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
)
ILMerge /targetplatform:v4,"%sldir%" /ndebug /log /out:%outdir%\WebSocket4Net.dll %srcdir%\WebSocket4Net.dll %srcdir%\SuperSocket.ClientEngine.dll
使用ILMerge合并WindowsPhone程式集:
set srcdir=D:\Bin\WindowsPhone
set outdir=D:\Bin\WindowsPhone\Output
set wpdir=%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71
if not exist "%wpdir%" (
set wpdir=%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71
)
ILMerge /targetplatform:v4,"%wpdir%" /ndebug /log /out:%outdir%\WebSocket4Net.dll %srcdir%\WebSocket4Net.dll %srcdir%\SuperSocket.ClientEngine.dll
使用ILMerge合并Mono for Android程式集:
set srcdir=D:\Bin\MonoDroid
set outdir=D:\Bin\MonoDroid\Output
set mddir=%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0
if not exist "%mddir%" (
set mddir=%ProgramFiles%\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0
)
ILMerge /targetplatform:v4,"%mddir%" /ndebug /log /out:%outdir%\WebSocket4Net.dll %srcdir%\WebSocket4Net.dll %srcdir%\SuperSocket.ClientEngine.dll