How to: Add Class Diagrams to Projects

You can begin designing, editing, and refactoring classes and other types in a Visual Studio project using Class Designer by adding a class diagram to the project. You can add blank class diagrams to your project, or you can create diagrams from existing types in your project. Each project can contain multiple class diagrams, useful for visualizing different code areas of the project.

To add a class diagram to a project

  1. In Solution Explorer, right-click the project name, and perform one of the following:

    • Click Add New Item.

    • Point to Add, and click New Item.

    The Add New Item dialog box appears.

  2. In the templates pane of the Add New Item dialog box, perform one of the following:

    • To create a class diagram with the default name, double-click Class Diagram.

    • To create a class diagram with another name, click Class Diagram, change the name in the Name box, and click Add.

    The class diagram opens in Class Designer and appears as a file that has a .cd extension in Solution Explorer in the project hierarchy. The Class Designer toolbox appears and contains shapes and lines that you can drag to the diagram.

  3. To add multiple class diagrams, repeat the steps in this procedure.

    Note that you can also create a class diagram for your solution by clicking the Class Diagram button in Solution Explorer, or by clicking View Class Diagram from the context menus of Class and Project nodes in SolutionExplorer and Namespace and Type nodes in ClassView.

See Also

Tasks

How to: Create Types on Class Diagrams

How to: View Existing Types

Other Resources

Designing Classes and Types

Viewing Types and Relationships on Class Diagrams

Working with Class Diagrams