How do I merge multiple .net assemblies into a single assembly?

前端 未结 3 599
忘了有多久
忘了有多久 2020-11-28 11:28

I have a .net application with about 10 assemblies. It would be nice to have them all together as a single assembly. How do I do it?

I guess something like a jar fil

相关标签:
3条回答
  • 2020-11-28 11:49

    Using ILMerge is probably the simplest solution. However, ILMerge has the drawback that it changes the identity of referenced assemblies. As a consequence, you might run into issues with security or serialization.

    An excellent blog post by Simone Busoli discusses the following options to merge assemblies into a single executable:

    1. ILMerge
    2. Embedding assemblies as a resource and subscribing to the AssemblyResolve event.
    3. Using Costura, an open source tool which takes care of embedding referenced assemblies as described in step 2.
    0 讨论(0)
  • ILMerge is the tool you're looking for:

    ILMerge

    The documentation for ILMerge can be found here:

    http://research.microsoft.com/en-us/people/mbarnett/ILMerge.aspx

    0 讨论(0)
  • 2020-11-28 12:00

    Try ILMerge.

    NuGet package here

    0 讨论(0)
提交回复
热议问题