This documentation is archived and is not being maintained.

How to: Add Class Diagrams to Projects (Class Designer)

Add a class diagram to your Visual C# .NET, Visual Basic .NET, or C++ project so you can design, edit, and refactor classes and other types in Visual Studio. 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 blank class diagram to a project

  1. In Solution Explorer, right-click the project name. Then choose Add New Item or Add, New Item.

  2. Under Templates, choose Class Diagram. For Visual C++ projects, look under Templates, and then under Utility to find this template.

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

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

To add a class diagram based on existing classes or types

  • In Solution Explorer, open the class file context menu, then choose View Class Diagram.


    In Class View, open the namespace or type context menu, then choose Class Diagram.