用ILMerge合并Silverlight, WindowsPhone或Mono for Android的程序集

为大家所知,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


posted @ 2012-01-09 13:47  江大渔  阅读(1319)  评论(2编辑  收藏  举报