Fix to Generate a Class Diagram en VS2019 – Project Web Net Core

First, check if you have installed the “Individual component” –> “Class Designer“. –> To check this, searching “Visual Studio Installer” in the Windows “Init“.
In the Visual Studio Installer wizard, select the Individual Components Tab, scroll down to the Code Tools Category and verify if you have the Class Designer option checked.

With this component installed, you should see:

Class diagram item

But with net core projects, I wasn’t be able to see it. I couldn’t find this option.
It’s strange but you can do the followings steps to add a Class diagram:

1) Right click in a folder/project –> Add new Item.

2) In my case, I will create a class diagram called:
–> It’s important the “.cd” extension.
–> I used a xml file

Maybe you see this message warning at the end of this step:

Don’t worry!

3) Right click in the diagram file –> Open with –> XML(Text) Editor

4)You should see:

<?xml version="1.0" encoding="utf-8" ?>

change that to:

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

–> Then, Save & Close the class diagram file

5) Re-Open class diagram file

Empty class diagram!

Excellent! Our class diagram works! Right now, we drag&drop the classes:

That’s all!

Big hug guys!