{"id":2728,"date":"2019-10-25T13:08:27","date_gmt":"2019-10-25T12:08:27","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=2728"},"modified":"2022-07-25T08:33:25","modified_gmt":"2022-07-25T07:33:25","slug":"c-merge-assemblies","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/c-merge-assemblies\/","title":{"rendered":"C# merge assemblies"},"content":{"rendered":"\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/8077570\/how-to-merge-multiple-assemblies-into-one\">https:\/\/stackoverflow.com\/questions\/8077570\/how-to-merge-multiple-assemblies-into-one<\/a><\/p>\n\n\n\n<p>You have several options:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>use <a href=\"http:\/\/www.microsoft.com\/download\/en\/details.aspx?displaylang=en&amp;id=17630\">ILMerge<\/a> (free)<br>\nFor howto see <a href=\"https:\/\/github.com\/Tigraine\/dotless\/blob\/master\/default.ps1#L87\">here<\/a> and <a href=\"http:\/\/research.microsoft.com\/en-us\/people\/mbarnett\/ILMerge.aspx\">here<\/a><\/li><\/ul>\n\n\n\n<p>OR<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>use some tool like <a href=\"http:\/\/www.red-gate.com\/products\/dotnet-development\/smartassembly\/\">SmartAssembly<\/a> (commercial)<br>\nit can embed and merge among other things (no need to change your source code)<\/li><\/ul>\n\n\n\n<p>OR<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/blogs.msdn.com\/b\/microsoft_press\/archive\/2010\/02\/03\/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx\">code that yourself in less than 10 lines<\/a> (free but minimal source code change)<br>\nmark all needed dependencies as &#8220;embedded resource&#8221; &#8211; this way they are included in the EXE file&#8230; you need to setup an <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.appdomain.assemblyresolve.aspx\"><code>AssemblyResolve<\/code><\/a> handler which at runtime reads from Resources and returns the needed DLLs to the .NET runtime&#8230;<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/stackoverflow.com\/questions\/8077570\/how-to-merge-multiple-assemblies-into-one You have several options: use ILMerge (free) For howto see here and here OR use some tool like SmartAssembly (commercial) it can embed and merge among other things (no need to change your source code) OR code that yourself in less than 10 lines (free but minimal source code change) mark all needed dependencies [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[6,4,1],"tags":[],"class_list":["post-2728","post","type-post","status-publish","format-standard","hentry","category-dotnet","category-programming","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/2728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=2728"}],"version-history":[{"count":1,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/2728\/revisions"}],"predecessor-version":[{"id":2729,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/2728\/revisions\/2729"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=2728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=2728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=2728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}