How to: Add Class Diagrams to Projects (Class Designer)
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
To design, edit, and refactor classes and other types, add a class diagram to your Visual C# .NET, Visual Basic .NET, or C++ project. To visualize different parts of the code in a project, add multiple class diagrams to the project.
You can't create class diagrams from projects that share code across multiple apps. To create UML class diagrams, see Create UML modeling projects and diagrams.
To add a blank class diagram to a project
In Solution Explorer, right-click the project name. Then choose Add New Item or Add, New Item.
From the template list, choose the 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.
To add multiple class diagrams, repeat the steps in this procedure.
To add a class diagram based on existing 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 View Class Diagram.
To display the contents of a complete project in a class diagram
In Solution Explorer or Class View, right-click the project and choose View, then choose View Class Diagram.
An auto-populated Class Diagram is created.
How to: Create Types by using Class Designer How to: View Existing Types (Class Designer) Designing Classes and Types (Class Designer) Viewing Types and Relationships (Class Designer) Working with Class Diagrams (Class Designer)