In Visual Studio 2010 I can generate class diagram from my project with 2 clicks. But now in Visual Studio 2013 I don't see the option "View Class Diagram" in project menu. Where did this item disappear? How can I generate class diagram from project now?
3 Answers
For creating real UML class diagrams:
In Visual Studio 2013 Ultimate you can do this without any external tools.
- In the menu, click on Architecture, New Diagram Select UML Class Diagram
- This will ask you to create a new Modeling Project if you don't have one already.
You will have a empty UMLClassDiagram.classdiagram.
- Again, go to Architecture, Windows, Architecture Explorer.
- A window will pop up with your namespaces, Choose Class View.
- Then a list of sub-namespaces will appear, if any. Choose one, select the classes and drag them to the empty UMLClassDiagram1.classdiagram window.
For Visual Studio 2019 and Visual Studio 2017 Users
For People who are missing this old feature in VS2019 (or maybe VS2017) from the old versions of Visual Studio
This feature still available, but it is NOT available by default, you have to install it separately.
- Open VS 2019 go to Tools -> Get Tools and Features
- Select the Individual components tab and search for Class Designer
- Select this Component and Install it, After finish installing this component (you may need to restart visual studio)
- Right-click on the project and select Add -> Add New Item
- Search for 'class' word and NOW you can see Class Diagram component
see this answer also to see an image associated
https://stackoverflow.com/a/66289543/4390133
(whish that the moderator realized this is the same question and instead of deleting my answer, he could mark one of the questions as duplicated to the other)
Update to create a class-diagram for the whole project
I received a downvote because I did not mention how to generate a diagram for the whole project, here is how to do it (after applying the previous steps)
- Add class diagram to the project
- if the option
Preview Selected Items
is enabled in the solution explorer, disabled it temporarily, you can re-enable it later
- open the class diagram that you created in step 2 (by double-clicking on it)
- drag-and-drop the project from the solution explorer to the class diagram