<p>We're attemtping to merge our DLL's into one for deployment, thus ILMerge.  Almost everything seems to work great.  We have a couple web controls that use <code>ClientScript.RegisterClientScriptResource</code> and these are 404-ing after the merge (These worked before the merge).</p>

<p>For example one of our controls would look like</p>

<pre><code>namespace Company.WebControls
{
  public class ControlA: CompositeControl, INamingContainer
  {
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        this.Page.ClientScript.RegisterClientScriptResource(typeof(ControlA), "Company.WebControls.ControlA.js");                
    }      
  }
}
</code></pre>

<p>It would be located in Project WebControls, assembly Company.WebControls.  Underneath would be ControlA.cs and ControlA.js.  ControlA.js is marked as an embedded resource.  In the AssemblyInfo.cs I include the following:</p>

<pre><code>[assembly: System.Web.UI.WebResource("Company.WebControls.ControlA.js", "application/x-javascript")]
</code></pre>

<p>After this is merged into CompanyA.dll, what is the proper way to reference this web resource?  The ILMerge command line is as follows (from the bin directory after the build): <code>"C:\Program Files\Microsoft\ILMerge\ILMerge.exe" /keyfile:../../CompanySK.snk /wildcards:True /copyattrs:True /out:Company.dll Company.*.dll</code></p>

[{'answer_id': 20380, 'author': 'John Hoven', 'author_id': 1907, 'author_profile': 'https://Stackoverflow.com/users/1907', 'pm_score': 3, 'selected': True, 'text': '<p>OK - I got this working.  It looks like the primary assembly was the only one whose assembly attributes were being copied.  With copyattrs set, the last one in would win, not a merge (as far as I can tell).  I created a dummy project to reference the other DLL\'s and included all the web resources from those projects in the dummy assembly info - now multiple resources from multiple projects are all loading correctly.</p>\n\n<p>Final post-build command line for dummy project:\n"C:\\Program Files\\Microsoft\\ILMerge\\ILMerge.exe" /keyfile:../../Company.snk /wildcards:True /out:Company.dll Company.Merge.dll Company.*.dll</p>\n'}, {'answer_id': 15519452, 'author': 'Genady Sergeev', 'author_id': 122199, 'author_profile': 'https://Stackoverflow.com/users/122199', 'pm_score': 0, 'selected': False, 'text': '<p>You need to set /allowMultiple along with /copyattrs. It is only then that ILMerge will merge the embedded resources from all assemblies.</p>\n'}]
['https://Stackoverflow.com/questions/20249', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1907/']