This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

Understand Code Dependencies with Visual Studio

612 views 0 comments last modified about 5 years ago Raymond

Visual Studio provides a convenient tool to generate visual code dependencies. It helps to identity circular references issues and also hubs.

To learn more details about this function, visit

Find the tool

Go to menu “Architecture –> Generate Dependency Graph” and you will be able to generate the visual diagrams for your projects or solution.


Sample – Hub


ContextProject.DataServices.The above diagram shows how my projects reference to each other.  Three projects are Hubs: ContextProject.Website, ContextProject.DataServices.Syndication, ContextProject.DataServices.MetaWeblog and ContextProject.DataServices, which implies that they are the top 25% highly connected nodes.


Because of these dependencies, it is hard to change and maintain the code. We can refactor can components to reduce the complexity of dependencies.

Sample – Circular Reference

Expand the assembly nodes,  we can identify the circular references.


In the above diagram, three namespaces form a circular reference. Drilling-down to details, I find out the static property Configurations caused this issue.


Sample – Other

I am planning to replace my IoC component NInject with Microsoft Unity. The visual dependency diagram can help me to find out all the classes/properties/methods I need to change.



The visual dependencies can help us identify code that might be overly complex or that might need improvement. It will be very useful when you begin to analyze a new project you didn’t work on before.

Related pages

ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

1005 views   1 comments last modified about 10 months ago

Background When upgrading Bootstrap to v4.0.0 release, the bundler and minifier doesn’t work properly due to CSS variable is commonly used: :root{--blue:#007bff; About 26 errors will show up in the Error List with the following message: ...

View detail

Migrate ASP.NET Core Projects – VS2015 to VS2017 and TFS2015 to TFS2017 Issues and Fixes

485 views   0 comments last modified about 2 years ago

Context Before Visual Studio 2017 was released, I was implementing my ASP.NET Core project using VS2015. TFS2015 is used for Continuous Build and Deployment for my projects. After migrating to VS2017, there are couple of issues I encountered in my environment: VS2017 has ...

View detail

开始下载安装Visual Studio 11 Beta吧!

275 views   0 comments last modified about 7 years ago


View detail

Visual Studio 2011 New Features 新增特性汇总

285 views   0 comments last modified about 8 years ago

本文将介绍Visual Studio 11 Express for Windows Developer Preview中包含的新特性。

View detail


298 views   0 comments last modified about 9 years ago

注:本文参照MSDN博客C# FAQ的文章;但不是完整翻译,而是提取主要内容以供大家参考,感谢原作者的奉献。一,Generate From Usage 从使用生成代码

View detail

VS2010新特性-Modeling Project-UML Sequence Diagram 时序图

350 views   0 comments last modified about 9 years ago


View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (0)

No comments yet.