Partilhar via


Visual Basic Concepts

Providing a Reference Point for Binary Version Compatibility

To determine the degree of compatibility between two versions of a component, Visual Basic needs a reference point. You provide this reference point by entering the path to a previously compiled version of your component in the Version Compatibility box on the tab of the Project Properties dialog box.

You need to do this whenever you begin work on a new version of a component you have shipped, put into production, or used as part of an application.

To specify a reference version of the component type library

  1. Open the project.

  2. From the Project menu, choose Project Properties to open the Project Properties dialog box, and select the Component tab.

  3. Click Binary Compatibility to lock down the class IDs in the project.

    Note   As explained in "Project Compatibility: Avoiding MISSING References," the Project Compatibility setting actually has nothing to do with the Version Compatibility feature.

  4. Update the box at the bottom of the Version Compatibility frame with the full path and name of the most recent version of your component.

Whenever you make a new executable from your component project, Visual Basic compares the new interfaces of your classes to the ones described in the file you have specified. Visual Basic updates the type library version number according to the level of compatibility between the interfaces.

For More Information   "Using Binary Version Compatibility" describes when and how to use the feature, problems you may encounter, and messages you may get from Visual Basic. See "Version Compatibility" for a list of topics related to this feature.