Visual Studio extension for analyzing C# projects and creating a UML class diagram visualization in the editor.
- Open a C# project in Visual Studio. An example project can be found in the visualizer-sample-project repository.
- Open the visualizer tool window by going to View > Other Windows > C# Project Visualizer. The window will initially be docked next to the Solution Explorer. It is recommended to un-dock the visualizer window and enlarge it to have more space for the class diagram.
- Select the project to analyze from the Select Project ComboBox. The ComboBox will list all projects in the opened solution.
- Click the
Generate Class Diagrambutton to analyze the project and display the UML class diagram.
Prerequisites: Visual Studio 2022 or later
The extension is available as a Visual Studio extension package (.vsix). To install the extension, download the latest release from the Releases page.
Once the .vsix file is downloaded, double-click it and follow the prompts to install the extension into Visual Studio. After installation, you may need to restart Visual Studio for the extension to be available.
The extension can be uninstalled at any time by using Visual Studio's extension management window under Extensions > Manage Extensions.
Prerequisites: Windows is required to build the source code.
Follow these steps to run the extension locally for development and testing:
- Install Visual Studio 2022. Include the following workloads in the Visual Studio Installer:
- .NET desktop development (for building .NET projects)
- Include the optional component .NET Framework 4.8 development tools (for building projects targeting .NET Framework)
- Visual Studio extension development (VS SDK, for building and testing the Visual Studio extension)
- .NET desktop development (for building .NET projects)
- Clone this repository and open the solution in Visual Studio.
- In Visual Studio, install the Extensibility Essentials 2022 by going to Extensions > Manage Extensions, searching for extensibility, and installing it.
- Run the extension in the Experimental Instance by pressing F5 or selecting Debug > Start Debugging. This will launch a new instance of Visual Studio with the extension installed.
- Follow the steps in the Usage section above to test the extension in the Experimental Instance.
- Certain object types are not supported by the analysis and are currently ignored in the analysis result.
- This is most noticeable with
recordsthat do not have an explicitclassorstructmodifier, which is a common syntax for defining data model objects in C# projects.
- This is most noticeable with
- There are cases where duplicate type names (i.e. specific generated files typically found in
\binor\objdirectories) can appear in the analysis result, which will throw an error when generating the class diagram. The extension filters out files in\binand\objdirectories, but these duplicate cases may occur if the build output directories are changed.