Deployment in Visual Studio-cab file project

Source: Internet
Author: User
    • Walkthrough: Create a cab file

Cab File Project-deployment in Visual Studio

Cab File Project


You can create a. cab file to package ActiveX controls that can be downloaded from a Web server to a web browser.

Unlike other deployment projects, no editor is provided to process the cab project. Files and project outputs can be added to the cab project of Solution Explorer. properties can be set in the Properties window or on the project properties page.

The properties of the cab Project allow you to specify the compression level, implement the Authenticode signature, set the display name and version information, and specify the location of the dependent files on the web.


The system does not calculate the dependencies of the cab project. You must determine and reference all Dependencies by yourself.



Create or add a cab Project

(Http:// (vs.71). aspixel)

The cab project is used to create compressed (. Cab) files that are used to download components to a web browser. If you wantCodeUse this option when running on the client computer instead of the server.

Create a new cab Project

    1. On the File menu, point to add project, and click New project ".
    2. In the "Add new project" dialog box, select the "Install and deploy project" folder.
    3. Select "cab project ".

Add an existing cab project to the solution

    1. On the File menu, point to add project, and click existing project ".
    2. In the displayed "add existing project" dialog box, browse to the location of the cab project and click "open ".


Walkthrough: Create a cab file

The following walkthrough shows how to create a cab file for the ActiveX control and deploy it on a web site so that it can be downloaded to the end user's browser.

Create a cab project for ActiveX Controls

    1. On the "file" menu, point to "new" and select "project ".
    2. In the Create Project dialog box, select "Install and deploy Project" in the "project type" pane, and select "cab Project" in the "template" pane ". In the Name box, typeAxcontrol.
    3. Click OK to close the dialog box.
    4. In Solution Explorer, select the "axcontrol" project. On the "project" menu, choose "add"> "File ".
    5. In the Add file dialog box, browse and find the ActiveX control (. ocx), and click OK to close the dialog box.
      Note:You can use ActiveX Control created by Visual Studio. NET or any. ocx file in the system directory.

    6. On the "project" menu, select "properties ".
    7. In the "Project Properties" dialog box, select the "Authenticode signature" check box, and enter "Certificate file", "Private Key File", and "timestamp server ". Click OK to close the dialog box.
      Note:This step is optional. However, if you do not use the Authenticode signature, you will not be able to download the cab file to the browser unless the browser's security settings allow you to download the unsigned ActiveX control.

    8. On the "generate" menu, select "generate axcontrol ".

Create a web applicationProgram

  1. On the File menu, choose add project> new project ".
  2. In the Add new project dialog box, select Visual Basic Project in the project type pane, and select ASP. NET web application in the template pane ". In the "location" box, typeHttp: // localhost/axcontrolweb.
  3. Click OK to close the dialog box.
  4. Select the Toolbox window. On the Tools menu, select Add/Remove toolbox items ".
  5. In the "Custom toolbox" dialog box, select the same ActiveX Control used in the previous process.
  6. Click OK to close the dialog box.
  7. In the Toolbox window, select the ActiveX control and drag it to the webform1.aspx designer.
  8. On the "project" menu, select "add existing item ".
  9. In the "add existing items" dialog box, locate the project directory and find the generated cab file. The default path is \ Documents and Settings \Yourloginname\ Axcontrol \Project Configuration\ Axcontrol. Cab. By default, "project configuration" is "debugging ". Click OK to close the dialog box.
    Note:You may need to type the file name (axcontrol. Cab) in the "file name" field ).

  10. In the webform1.aspx designer, select the ActiveX control.
  11. In the "properties" window, selectCodebaseProperties and click the ellipsis () button.
  12. In the create URL dialog box, select axcontrol. cab from the directory pane, and click OK to close the dialog box.
    Note:If you change the cab file project, you need to regenerate the cab file project, delete the old cab file from the web project, and repeat steps 6 and 7. This is necessary because the cab file in the web project is actually a copy of the generated cab file.

  13. On the "generate" menu, select "generate SOLUTION ".

Test installation

    • Browse to the web page of the computer where the ActiveX control is not registered (http ://Computername/Axcontrolweb/webform1.aspx ). Make sure that the control is installed on this computer and the Authenticode dialog box is displayed.



Http:// (vs.71). aspx

Http:// (V = vs.80)

Http:// (C # Develop ActiveX control and make cab package)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.