How to add a Class Diagram to an ASP.NET Core project in VS 2017?

Well as answered here, this is a known issue (VOTE for MS to fix it!)

As a workaround, From the New File dialog box create a plain XML named Diagram.cd (replace Diagram with your choice), right click the file and select Open With..., and select XML (Text) Editor, then replace its contents with the following:

<?xml version="1.0" encoding="utf-8" ?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
  <Font Name="Segoe UI" Size="9" />
</ClassDiagram>

Then close the file saving it. When you reopen it normally it should work now.


I used Type Dependency Diagram and it worked perfectly for me. Find the class that you want to explore:

Mouse: Right Button ClickShow Type Dependency Diagram

Then just drag and drop all your other related class and Visual Studio will build a nice diagram for you.