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:
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: patternMatchingClassDiagram.cd
–> 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" /> </ClassDiagram>
–> Then, Save & Close the class diagram file
5) Re-Open class diagram file
Excellent! Our class diagram works! Right now, we drag&drop the classes:
That’s all!
Big hug guys!
5 thoughts on “Fix to Generate a Class Diagram en VS2019 – Project Web Net Core”
Leave a Reply
You must be logged in to post a comment.
Not working for me, after closing and reopen the .cd file, it is not showing the class diagram.
That’s is unusual my friend but maybe it could be the VS 2019 version, remember when I wrote this article VS 2019 had just released!
Thank you so much for this fix! I spent hours trying to solve this exact problem. Thank you!
Excellent my friend! I’m happy that this post helps you š
Thanks