Getting Started with NDepend

Getting started with NDepend (3mn)

Tutorial with explanations and screenshots

Installing the NDepend extension for Visual Studio 2019, 2017, 2015, 2013, 2012 or 2010

  1. Download the NDepend installation zip file
  2. To install NDepend, just unzip the files in a private application folder on your machine. Don't unzip files in '%ProgramFiles%\NDepend'. This might provoke problems because of Windows protection.
  3. If you are running NDepend Professional Version, just type your license key in the NDepend activation dialog to activate your machine.
  4. Start NDepend.VisualStudioExtension.Installer.exe
  5. Click the button Install for the right Visual Studio version visual studio vsix installer of the NDepend extension
  6. Start Visual Studio

Analyzing a Visual Studio solution

  1. Start Visual Studio after having installed the NDepend addin.
  2. Open the Visual Studio solution containing the code to analyze.
  3. Click the greyed NDepend circle status (bottom right of the Visual Studio window) OR click the menu NDepend > Attach new NDepend project to current Visual Studio solution
      Note:
    • A NDepend project can be attached to several Visual Studio solutions.
    • This is useful if you wish to analyze several .NET assemblies compiled with several Visual Studio solutions.
    • A benefit will be the possibility to navigate across several Visual Studio solutions opened in several Visual Studio instances.
    attach new ndepend project to the current visual studio solution menu
  4. The dialog opened proposes to create a new NDepend project (.ndproj file extension) that references the Visual Studio solution .sln file. This NDepend project file will be then referenced by the .sln file, this is how it is attached to it. By default projects containing test in their names are filtered out, they are not analyzed. If needed you can modify the filter(s). You can also reference more assemblies from the tab No assembly outside the VS solution will be analyzed.

    attach new ndepend project to the current visual studio solution dialog

  5. Click Ok : the NDepend analysis start. It will just take a few seconds to analyze your code base for the first time. If you let the Build Report check box checked, a report will be created and shown in a new browser window.

Analyzing a .NET applications using Visual NDepend

The NDepend Visual Studio extension has no impact on the Visual Studio process performances. However if you prefer you can use 100% of NDepend features outside Visual Studio thanks to the standalone executable VisualNDepend.exe. To do so:

  1. Start VisualNDepend.exe
  2. Select one of the options:
    • Analyze Visual Studio solutions and Visual Studio projects
    • Analyze .NET assemblies in folder
    • Analyze a set of .NET assemblies
    ndepend start page
  3. Click OK. It will trigger the analysis of your assemblies and code source by NDepend.Console.exe. This analysis will take a few seconds. Once done, the result is displayed in the VisualNDepend.exe UI.

Use Cases

NDepend is a feature rich product. To help you get started quickly you can refer to the use cases that best fulfill your needs: