#756 – Viewing a Class Diagram in Visual Studio 2012

You can create and view a class diagram from within Visual Studio that shows all of the types in your project and their relationships.  This is helpful in understanding how your project is structured.

To create a class diagram that allows viewing all types in your project, do the following.

In Solution Explorer, right-click the project and select View Class Diagram.

756-001

 

A diagram will appear that shows all of the types in your project.  In this example, the diagram also shows that Terrier is a subclass of Dog and that the Dog class implements the IBark and IFetch interfaces.

You can also click on the double down arrow icon to expand any of the types.  (You may have to move them around to make things look pretty again).

756-003

 

You can also navigate to the code for any member shown in the diagram, by right-clicking on the member and selecting View Code.

756-004

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

8 Responses to #756 – Viewing a Class Diagram in Visual Studio 2012

  1. Pingback: #759 – Creating a New Type from a Class Diagram « 2,000 Things You Should Know About C#

  2. madhu says:

    Good post.. sometimes, we as developers just forget simple things. Nice work with the c# 2k things. Thank you.

  3. Noel says:

    How would I write this in Visual Studio 2012?

  4. Katie says:

    Are we able to view class diagrams in visual studio 2012 express? I haven’t been able to find it.

  5. David says:

    In Community Edition is also available, but the best option is this: https://msdn.microsoft.com/en-us/library/ff657806.aspx

Leave a comment