Deploying the IE Web Controls with your Application

I have an ASP.NET application that requires the IE Web Controls.  (If you don't know what these are, read this.)  I wanted to create a deployment project for my application, and of course, ran into trouble.  How does one install the Web Controls along with the application?  (See Jon?  I'm blogging it!)

First, what needs to be installed?  Here is my list:

  • Application Root
    • BIN directory
      Microsoft.Web.UI.WebControls.dll
  • webctrl_client virtual root
    • 1_0 Directory
      MultiPage.htc
      webservice.htc
      treeview.htc
      toolbar.htc
      webserviced.htc
      TabStrip.htc
      • images Directory
        folderopen.gif
        folder.gif
        root.gif
        html.gif
      • treeimages Directory
        f.gif
        fminus.gif
        fplus.gif
        i.gif
        L.gif
        Lminus.gif
        Lplus.gif
        minus.gif
        plus.gif
        r.gif
        Rminus.gif
        Rplus.gif
        T.gif
        Tminus.gif
        Tplus.gif
        white.gif
        • rtl Directory
          F.gif
          Fminus.gif
          Fplus.gif
          I.gif
          L.gif
          Lminus.gif
          Lplus.gif
          minus.gif
          plus.gif
          r.gif
          Rminus.gif
          Rplus.gif
          T.gif
          Tminus.gif
          Tplus.gif
          white.gif

Setting up the application BIN directory is easy.  You just add the project's primary output to the Web application folder in the normal way, using the deployment project's File System Editor.  Getting the deployment project to include the other files, in the correct folder, caused me a bit of frustration.  Of course, once I stumbled upon the answer, if was painfully obvious.  Here are the steps:

  1. Using the File Editor, create a new Web Folder and call it whatever you like.  In the Properties dialog box, clear the entry called VirtualDirectory.  It must be blank.  This is the key.  When this property is set to nothing, the Web Folder is placed in the Web Root folder.
  2. Add a Web Folder under this called webctrl_client.
  3. Add a Web Folder under webctrl_client called 1_0.  Place the appropriate files in this directory.
  4. Add a Web Folder under 1_0 called images.  Place the appropriate files in this directory.
  5. Add a Web Folder under 1_0 called treeimages.  Place the appropriate files in this directory.
  6. Add a Web Folder under treeimages called rtl.  Place the appropriate files in this directory.
Build the project, and deploy it.  It will now install Microsoft.Web.UI.WebControls.dll into the application BIN directory, and the various Web Control resource files into a virtual directory off the Web Site root.
 
Final Note:  Don't get so happy with your cleverness that you forget to add the project's content files to the Web Application folder like I did.  ASP.NET pages don't work very well without the appropriate .aspx files.   :)

Comments