title: ILMerge and Web Resources
body: <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>