1
votes

I am using the class diagram extension of Visual Studio 2019 (.NET 5/Standard project).
But sometimes I get a very annoying error message when I try to drag & drop a class from the Class view in the design surface:

enter image description here

The error message appears in different cases - pretty much randomly. My whole project has no errors or warnings and can be built without any problems. Also the class I want to drag inside the project is referenced by the project with the .cd-file or even inside of it.
So all criterias why the error message could appear are false - I should be able to add the class.

But I cant.

Do you have any ideas what I could try to troubleshoot this? I get the same message if I re-create my whole diagram...

1

1 Answers

0
votes

I did not find any explanation for the error message, but I found a solution that works. Just open the class diagram with XML. Then a manual entry of the error prone type can be done like this:

  <Class Name="{THE NAMESPACE PATH TO YOUR TYPE}">
<Position X="49.25" Y="5" Width="3" />
<TypeIdentifier />

After saving the file and re-opening the diagram I find my type.
Its a dirty workaround, but works perfect. I can also change the diagram with the GUI after I added it in this way.