Generate a class diagram from Visual Studio

For generating the class diagram visual studio is providing the in-built option please use that, Go to class view window of your project, RightClick -> select View -> click on View Class Diagram. This will generate class diagram for your project.

Ref:

  • https://msdn.microsoft.com/en-us/library/ff657806.aspx
  • How to generate class diagram from project in Visual Studio 2013?

Thanks


For Visual Studio 2017, 2019 and 2022


This feature is still available, but it is NOT installed by default, you have to install it separately.

  1. From inside Visual Studio go to Tools -> Get Tools and Features
  2. Select the Individual components tab and search for Class Designer
  3. Check this Component and Install it

enter image description here

After finish installing this component

  1. Right-click on the project and select Add -> Add New Item A. Search for 'class' word and NOW you can see Class Diagram component

enter image description here

Very Important Update From the Comments below

  1. Right-clicking on a folder and selecting Add New Item will NOT show the Class Diagram option
  2. Not every project type will support Class Diagram For example,
    Right-clicking on Class Library project and selecting Add New Item will DO show Class Diagram options
    But Right-clicking on ASP.NET project and selecting Add New Item will NOT show Class Diagram options